mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
glocalfileoutputstream: Do not double-close an fd on unlink error
In case we fail unlinking a file we could close again an FD that has been already just closed. So avoid this by unsetting it when closing. Coverity CID: #1474462
This commit is contained in:
parent
d37beda25e
commit
2401e1a090
@ -1194,6 +1194,7 @@ handle_overwrite_open (const char *filename,
|
|||||||
if (replace_destination_set)
|
if (replace_destination_set)
|
||||||
{
|
{
|
||||||
g_close (fd, NULL);
|
g_close (fd, NULL);
|
||||||
|
fd = -1;
|
||||||
|
|
||||||
if (g_unlink (filename) != 0)
|
if (g_unlink (filename) != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user