ppdgenerator.c: Free printer_sizes array
We need to free 'printer_sizes', which is allocated in 'ppdCreateFromIPP2()', instead of
'sizes', which is passed as a parameter - because it solves a memory leak and it doesn't
leave an invalid pointer.
@@ -2353,8 +2353,6 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
twidth, tlength);
}
- cupsArrayDelete(sizes);
-
/*
* Custom size support...
*/
@@ -2393,7 +2391,6 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
cupsFilePuts(fp, "*CustomPageSize True: \"pop pop pop <</PageSize[5 -2 roll]/ImagingBBox null>>setpagedevice\"\n");
}
} else {
- cupsArrayDelete(sizes);
cupsFilePrintf(fp,
"*%% Printer did not supply page size info via IPP, using defaults\n"
"*OpenUI *PageSize/Media Size: PickOne\n"
@@ -2460,6 +2457,8 @@ ppdCreateFromIPP2(char *buffer, /* I - Filename buffer */
"*PaperDimension EnvMonarch/Envelope Monarch: \"279 540\"\n");
}
+ cupsArrayDelete(printer_sizes);
+
/*
* InputSlot...
*/
