diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-11-09 15:25:40 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-11-10 05:56:06 +0000 |
commit | 20a7e7fe42dfa9e5de91ebfffc2cfd128099fa6a (patch) | |
tree | 6a6ca29fd654f6f28f9676b8446158583f39aa9c /file.c | |
parent | 6c3c6de340ff2016b06c0081c6c822c723d40f80 (diff) | |
download | wireshark-20a7e7fe42dfa9e5de91ebfffc2cfd128099fa6a.tar.gz |
file.c: do not try to close a file descriptor that was previously already closed
Bug: 11684
Change-Id: Iaaa5958ea6192ef52b669c687082469b8c7c0219
Reviewed-on: https://code.wireshark.org/review/11656
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |