From 4f1801ca11a50187b51916813a3a331e4e3190ba Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Sun, 14 Jul 2013 21:38:23 +0400 Subject: [PATCH] Ticket #3040: (check_file_access): fix file descriptor leak. Signed-off-by: Andrew Borodin --- src/editor/edit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/editor/edit.c b/src/editor/edit.c index 1dc8cf14a..c0b0016be 100644 --- a/src/editor/edit.c +++ b/src/editor/edit.c @@ -325,6 +325,8 @@ check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat } cleanup: + (void) mc_close (file); + if (errmsg != NULL) { edit_error_dialog (_("Error"), errmsg); @@ -332,9 +334,6 @@ check_file_access (WEdit * edit, const vfs_path_t * filename_vpath, struct stat ret = FALSE; } - if (!ret) - (void) mc_close (file); - return ret; }