alexivkin / CUPS-PDF-to-PDF

CUPS-PDF with a patch to print text correctly
GNU General Public License v2.0
31 stars 12 forks source link

Handle leak in cups-pdf.c #10

Open sminux opened 6 months ago

sminux commented 6 months ago

The bug was detected via svace1 static analyzer scanning.

The handle 'fpdest' is created at https://github.com/alexivkin/CUPS-PDF-to-PDF/blob/c14428c2ca8e95371daad7db6d11c84046b1a2d4/cups-pdf.c#L718 by calling function 'fopen' and lost at https://github.com/alexivkin/CUPS-PDF-to-PDF/blob/c14428c2ca8e95371daad7db6d11c84046b1a2d4/cups-pdf.c#L727

Do we need (void) fclose(fpdest); before return?