From 96acc6d8efe65471bce7522d610e31ad2bae5a35 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 19 Apr 2020 11:17:39 +0200 Subject: [PATCH] lib/portableproplib/prop_object.c: fix CID 284969 (Double free). --- lib/portableproplib/prop_object.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/portableproplib/prop_object.c b/lib/portableproplib/prop_object.c index 50cd9183..58dc7da3 100644 --- a/lib/portableproplib/prop_object.c +++ b/lib/portableproplib/prop_object.c @@ -883,11 +883,12 @@ _prop_object_externalize_write_file(const char *fname, const char *xml, if (fchmod(fd, 0666 & ~myumask) == -1) goto bad; - if (do_compress) + if (do_compress) { (void)gzclose(gzf); - else + gzf = NULL; + } else { (void)close(fd); - + } fd = -1; if (rename(tname, fname) == -1)