]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
foomatic-rip: remove tempfile created during pdf-to-ps conversion 313/head
authorBryan Mason <bmason@redhat.com>
Tue, 27 Oct 2020 03:36:11 +0000 (20:36 -0700)
committerBryan Mason <bmason@redhat.com>
Tue, 27 Oct 2020 03:36:11 +0000 (20:36 -0700)
filter/foomatic-rip/foomaticrip.c

index e0c68462525b509794dcfb93be67d37f4abf33d8..145982737e156a0856997d7564acaba5a9f47dec 100644 (file)
@@ -560,7 +560,7 @@ int print_file(const char *filename, int convert)
 {
     FILE *file;
     char buf[8192];
-    char tmpfilename[PATH_MAX];
+    char tmpfilename[PATH_MAX] = "";
     int type;
     int startpos;
     int pagecount;
@@ -689,6 +689,10 @@ int print_file(const char *filename, int convert)
                 if (out != NULL)
                   fclose(out);
 
+                // Delete temp file if we created one
+                if ( *tmpfilename )
+                    unlink(tmpfilename);
+
                 return ret;
             }