From 0db48ff9e2728115654309ecffce88b52f2744cf Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 19:55:19 +0000 Subject: Apply patch libpaper-file-leak.patch patch_name: libpaper-file-leak.patch present_in_specfile: true --- diff --git a/lib/paper.c b/lib/paper.c index 0039bb0..57db599 100644 --- a/lib/paper.c +++ b/lib/paper.c @@ -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 behaviour. } } + if (ps) + fclose(ps); + paperdef = defaultpapername(); paperstr = malloc((strlen(paperdef) + 1) * sizeof(char));