diff options
-rw-r--r-- | capture_opts.c | 1 | ||||
-rw-r--r-- | tshark.c | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/capture_opts.c b/capture_opts.c index b384a38560..daef16e000 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -140,6 +140,7 @@ capture_opts_cleanup(capture_options *capture_opts) g_array_free(capture_opts->all_ifaces, TRUE); capture_opts->all_ifaces = NULL; } + g_free(capture_opts->save_file); } /* log content of capture_opts */ @@ -728,7 +728,7 @@ main(int argc, char *argv[]) int log_flags; gchar *output_only = NULL; gchar *volatile pdu_export_arg = NULL; - const char *volatile exp_pdu_filename = NULL; + char *volatile exp_pdu_filename = NULL; exp_pdu_t exp_pdu_tap_data; #ifdef HAVE_JSONGLIB const gchar* elastic_mapping_filter = NULL; @@ -1113,7 +1113,7 @@ main(int argc, char *argv[]) * Output file name, if we're reading a file and writing to another * file. */ - output_file_name = optarg; + output_file_name = g_strdup(optarg); } else { capture_option_specified = TRUE; arg_error = TRUE; @@ -2078,6 +2078,7 @@ main(int argc, char *argv[]) exit_status = 2; } g_free(pdu_export_arg); + g_free(exp_pdu_filename); } } else { tshark_debug("tshark: no capture file specified"); @@ -2249,6 +2250,8 @@ clean_exit: destroy_print_stream(print_stream); #ifdef HAVE_LIBPCAP capture_opts_cleanup(&global_capture_opts); +#else + g_free(output_file_name); #endif col_cleanup(&cfile.cinfo); free_filter_lists(); |