Blame SOURCES/libpaper-file-leak.patch

2072e9
diff -up libpaper-1.1.24+nmu5/lib/paper.c.file-leak libpaper-1.1.24+nmu5/lib/paper.c
2072e9
--- libpaper-1.1.24+nmu5/lib/paper.c.file-leak	2018-03-09 16:21:01.028345956 +0100
2072e9
+++ libpaper-1.1.24+nmu5/lib/paper.c	2018-03-09 16:40:57.824279357 +0100
2072e9
@@ -140,7 +140,7 @@ char* systempapername(void) {
2072e9
     char* paperstr;
2072e9
     char* paperenv;
2072e9
     const char* paperdef;
2072e9
-    FILE* ps;
2072e9
+    FILE* ps = NULL;
2072e9
     struct stat statbuf;
2072e9
     const struct paper* pp;
2072e9
     int c;
2072e9
@@ -224,6 +224,9 @@ PAPERSIZEVAR, fall-back to the old behav
2072e9
 	}
2072e9
     } 
2072e9
       
2072e9
+    if (ps)
2072e9
+      fclose(ps);
2072e9
+
2072e9
     paperdef = defaultpapername();
2072e9
     paperstr = malloc((strlen(paperdef) + 1) * sizeof(char));
2072e9