close temporary merge output file, if merging failed

svn path=/trunk/; revision=11275
This commit is contained in:
Ulf Lamping 2004-06-30 05:49:30 +00:00
parent 14ef5684fa
commit 24527148ab
2 changed files with 9 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/* file_dlg.c
* Dialog boxes for handling files
*
* $Id: file_dlg.c,v 1.125 2004/06/29 20:59:23 ulfl Exp $
* $Id: file_dlg.c,v 1.126 2004/06/30 05:49:29 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -59,6 +59,11 @@
#include "merge.h"
#include "util.h"
#ifdef HAVE_IO_H
#include <io.h> /* open/close on win32 */
#endif
static void file_open_ok_cb(GtkWidget *w, gpointer fs);
static void file_open_destroy_cb(GtkWidget *win, gpointer user_data);
@ -989,6 +994,7 @@ file_merge_ok_cb(GtkWidget *w, gpointer fs) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"An error occurred while merging the files: %s.",
wtap_strerror(err));
close(out_fd);
if (rfcode != NULL)
dfilter_free(rfcode);
return;

View File

@ -1,6 +1,6 @@
/* main.c
*
* $Id: main.c,v 1.449 2004/06/29 20:59:24 ulfl Exp $
* $Id: main.c,v 1.450 2004/06/30 05:49:30 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1310,6 +1310,7 @@ dnd_merge_files(int in_file_count, char **in_filenames)
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"An error occurred while merging the files: \"%s\".",
wtap_strerror(err));
close(out_fd);
return;
}