Merge branch 'local-output-stream-prevent-double-fd-close' into 'main'

glocalfileoutputstream: Do not double-close an fd on unlink error

See merge request GNOME/glib!2901
This commit is contained in:
Marco Trevisan 2022-09-20 13:19:04 +00:00
commit 7b53edbf26

View File

@ -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)
{ {