libpaper/libpaper-file-leak.patch
Petr Šabata d5be3f8985 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/libpaper#76682b3284f9b5b07f0f0e7fb21b47f5dd7a596b
2020-10-15 16:53:50 +02:00

23 lines
684 B
Diff

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));