[BUG] deallocating an allready deallocated file pointer in file backend/scsi.c

Ettl Martin ettl.martin at gmx.de
Sun Aug 2 03:27:51 PDT 2009


Hello friends,

i have checked the sources of cups with the static code analysis tool cppcheck. If found an issue in file backend/scsi.c. The tool prints the following message:

../backend/scsi.c,221,error,Deallocating a deallocated pointer: fp

Take a look at the code:
....
214  status = print_device(resource, fp, copies);

 /*
  * Close input file and return...
  */

220  if (fp != 0)
221    close(fp);
...

The file pointer is allready closed during the function call of print_device(..,fp,..). print_dev is declared in file scsi-linux.c.
So, the static code analysis tool is right. This is a bug.

Best regards

Ettl Martin





More information about the cups-devel mailing list