aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/file.c b/file.c
index 16972ffdf7..b83bd27138 100644
--- a/file.c
+++ b/file.c
@@ -1382,11 +1382,13 @@ cf_merge_files(char **out_filenamep, int in_file_count,
case MERGE_ERR_CANT_OPEN_INFILE:
cf_open_failure_alert_box(in_filenames[err_fileno], err, err_info,
FALSE, 0);
+ ws_close(out_fd);
break;
case MERGE_ERR_CANT_OPEN_OUTFILE:
cf_open_failure_alert_box(out_filename, err, err_info, TRUE,
file_type);
+ ws_close(out_fd);
break;
case MERGE_ERR_CANT_READ_INFILE: /* fall through */
@@ -1399,7 +1401,8 @@ cf_merge_files(char **out_filenamep, int in_file_count,
}
g_free(err_info);
- ws_close(out_fd);
+ /* for general case, no need to close out_fd: file handle associated to this file
+ descriptor was already closed by the call to wtap_dump_close() in merge_files() */
if (status != MERGE_OK) {
/* Callers aren't expected to treat an error or an explicit abort