8d5e9d
diff --git a/filter/foomatic-rip/foomaticrip.c b/filter/foomatic-rip/foomaticrip.c
8d5e9d
index 7dc2426..146125f 100644
8d5e9d
--- a/filter/foomatic-rip/foomaticrip.c
8d5e9d
+++ b/filter/foomatic-rip/foomaticrip.c
8d5e9d
@@ -672,6 +672,12 @@ int print_file(const char *filename, int convert)
8d5e9d
                 if (out != NULL)
8d5e9d
                   fclose(out);
8d5e9d
 
8d5e9d
+		// Delete temp file if we created one
8d5e9d
+		if ( *tmpfilename ) {
8d5e9d
+		  _log("Removing temporary file %s\n", tmpfilename);
8d5e9d
+		  unlink(tmpfilename);
8d5e9d
+		}
8d5e9d
+
8d5e9d
                 return ret;
8d5e9d
             }
8d5e9d