mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-16 15:10:23 +02: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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user