aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2006-11-02 09:45:12 +0000
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2006-11-02 09:45:12 +0000
commitd23aa74b403012294598f58f3d6d1ac983833cfe (patch)
tree1544dff0eb3db3e58d4f8f254472fb9f47ec3ed3 /capture_opts.c
parentf0ea386797ca20bc1a7c6db4bad98dd024cb3755 (diff)
Frederic Heem:
Fix some memleaks and overflows. I haven't committed the changes that are not bug fixes. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19777 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_opts.c')
-rw-r--r--capture_opts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/capture_opts.c b/capture_opts.c
index 70bccc2d6f..49326c5b3d 100644
--- a/capture_opts.c
+++ b/capture_opts.c
@@ -330,6 +330,7 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg,
return 1;
}
capture_opts->has_cfilter = TRUE;
+ g_free(capture_opts->cfilter);
capture_opts->cfilter = g_strdup(optarg);
break;
case 'H': /* Hide capture info dialog box */
@@ -361,6 +362,7 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg,
break;
case 'w': /* Write to capture file x */
capture_opts->saving_to_file = TRUE;
+ g_free(capture_opts->save_file);
#if defined _WIN32 && (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6))
/* since GLib 2.6, we need to convert filenames to utf8 for Win32 */
capture_opts->save_file = g_locale_to_utf8(optarg, -1, NULL, NULL, NULL);