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