mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-04 02:06:18 +01:00
glocalfileoutputstream: Fix an FD leak in an error path
If a backup file is created, opened successfully, then fstat() on it fails (perhaps due to another process deleting it in the mean time?), the FD will be leaked. Coverity issue: #1159485 https://bugzilla.gnome.org/show_bug.cgi?id=730187
This commit is contained in:
parent
195a0cb6bb
commit
16d674411f
@ -953,6 +953,7 @@ handle_overwrite_open (const char *filename,
|
||||
G_IO_ERROR_CANT_CREATE_BACKUP,
|
||||
_("Backup file creation failed"));
|
||||
g_unlink (backup_filename);
|
||||
(void) g_close (bfd, NULL);
|
||||
g_free (backup_filename);
|
||||
goto err_out;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user