summaryrefslogtreecommitdiffstats
path: root/libpaper-file-leak.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-09-25 12:59:49 +0200
committerRemi Collet <remi@remirepo.net>2019-09-25 12:59:49 +0200
commitae853c7a30c94a4a647588f8f5b41d4f0bb27f08 (patch)
tree609c4641c4bb7ac93fd8fa73d2d0c2a54bd16ac8 /libpaper-file-leak.patch
parent223e6be1b1cebd9b1d39a9d2f191e87012f497ce (diff)
- rebuild for remirepo for https://bugzilla.redhat.com/1753534HEADmaster
using patch from Fedora - fix covscan issue - memory leak - fix file descriptor leak
Diffstat (limited to 'libpaper-file-leak.patch')
-rw-r--r--libpaper-file-leak.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/libpaper-file-leak.patch b/libpaper-file-leak.patch
new file mode 100644
index 0000000..47b878b
--- /dev/null
+++ b/libpaper-file-leak.patch
@@ -0,0 +1,22 @@
+diff -up libpaper-1.1.24+nmu5/lib/paper.c.file-leak libpaper-1.1.24+nmu5/lib/paper.c
+--- libpaper-1.1.24+nmu5/lib/paper.c.file-leak 2018-03-09 16:21:01.028345956 +0100
++++ libpaper-1.1.24+nmu5/lib/paper.c 2018-03-09 16:40:57.824279357 +0100
+@@ -140,7 +140,7 @@ char* systempapername(void) {
+ char* paperstr;
+ char* paperenv;
+ const char* paperdef;
+- FILE* ps;
++ FILE* ps = NULL;
+ struct stat statbuf;
+ const struct paper* pp;
+ int c;
+@@ -224,6 +224,9 @@ PAPERSIZEVAR, fall-back to the old behav
+ }
+ }
+
++ if (ps)
++ fclose(ps);
++
+ paperdef = defaultpapername();
+ paperstr = malloc((strlen(paperdef) + 1) * sizeof(char));
+