Some filter functions do not close the input file when it comes to an error opening a temporary file to copy the input into. This causes a memory leak in continuously running callers, like Printer Applications.
{
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
"ghostscript: Unable to copy PDF file: %s", strerror(errno));
+ fclose(fp);
return (1);
}
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
"imagetopdf: Unable to copy input: %s",
strerror(errno));
+ fclose(fp);
return (1);
}
if (log) log(ld, FILTER_LOGLEVEL_ERROR,
"imagetoraster: Unable to copy input: %s",
strerror(errno));
+ fclose(fp);
return (1);
}