fix a bug if capturing into named files is used

svn path=/trunk/; revision=13345
This commit is contained in:
Ulf Lamping 2005-02-07 20:38:10 +00:00
parent 30a00ead93
commit d2cf31dc22
1 changed files with 3 additions and 1 deletions

View File

@ -397,7 +397,9 @@ capture_open_output(capture_options *capture_opts, gboolean *is_tempfile) {
/* close the old file */
cf_close(capture_opts->cf);
g_assert(capture_opts->save_file == NULL);
if(capture_opts->save_file != NULL) {
g_free(capture_opts->save_file);
}
capture_opts->save_file = capfile_name;
/* capture_opts.save_file is "g_free"ed later, which is equivalent to
"g_free(capfile_name)". */