lib/portableproplib/prop_object.c: fix CID 284969 (Double free).

This commit is contained in:
Juan RP 2020-04-19 11:17:39 +02:00
parent 83d87ce05b
commit 96acc6d8ef
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -883,11 +883,12 @@ _prop_object_externalize_write_file(const char *fname, const char *xml,
if (fchmod(fd, 0666 & ~myumask) == -1) if (fchmod(fd, 0666 & ~myumask) == -1)
goto bad; goto bad;
if (do_compress) if (do_compress) {
(void)gzclose(gzf); (void)gzclose(gzf);
else gzf = NULL;
} else {
(void)close(fd); (void)close(fd);
}
fd = -1; fd = -1;
if (rename(tname, fname) == -1) if (rename(tname, fname) == -1)