aboutsummaryrefslogtreecommitdiffstats
path: root/capture_opts.c
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2006-11-02 09:45:12 +0000
committerJörg Mayer <jmayer@loplof.de>2006-11-02 09:45:12 +0000
commit23ce819952282ef05d3fe29cf82d3ea2495065f0 (patch)
tree1544dff0eb3db3e58d4f8f254472fb9f47ec3ed3 /capture_opts.c
parent003db517095c19dab06a1871485d5e0c607b43c6 (diff)
Frederic Heem:
Fix some memleaks and overflows. I haven't committed the changes that are not bug fixes. svn path=/trunk/; revision=19777
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);