lib/portableproplib/prop_object.c: fix CID 284969 (Double free).
This commit is contained in:
parent
83d87ce05b
commit
96acc6d8ef
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user