| |
@@ -387,9 +387,9 @@
|
| |
backup_name = g_strconcat(e->filename, "-", NULL);
|
| |
fd = open_and_copy_file(e->filename, backup_name, FALSE, error);
|
| |
g_free (backup_name);
|
| |
- close(fd);
|
| |
if (fd == -1)
|
| |
goto err_fscreate;
|
| |
+ close(fd);
|
| |
|
| |
e->new_filename = g_strconcat(e->filename, "+", NULL);
|
| |
e->new_fd = open_and_copy_file(e->filename, e->new_filename, TRUE,
|
| |
Merges:
https://pagure.io/libuser/issue/26
The code used to first close(fd) and only then check if it's != -1.
Reverse the logic so that the fd is only closed if valid.