summaryrefslogtreecommitdiffstats
path: root/libpaper-covscan.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-covscan.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-covscan.patch')
-rw-r--r--libpaper-covscan.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/libpaper-covscan.patch b/libpaper-covscan.patch
new file mode 100644
index 0000000..43d0794
--- /dev/null
+++ b/libpaper-covscan.patch
@@ -0,0 +1,16 @@
+diff --git a/lib/paper.c b/lib/paper.c
+index 57db599..8817aea 100644
+--- a/lib/paper.c
++++ b/lib/paper.c
+@@ -211,7 +211,10 @@ PAPERSIZEVAR, fall-back to the old behaviour.
+ fclose(ps);
+
+ paperstr = malloc((strlen(papername) + 1) * sizeof(char));
+- if (! paperstr) return 0;
++ if (! paperstr) {
++ free(papername);
++ return 0;
++ }
+
+ strcpy(paperstr, papername);
+ free(papername);