summaryrefslogtreecommitdiff
path: root/capture.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-10-23 15:31:48 +0000
committerMichael Mann <mmann78@netscape.net>2013-10-23 15:31:48 +0000
commit36e13a4c55a5080ae504691c8062f359c3c8668f (patch)
treefa4d5a37b86fca39ef830c568473791cb1fc93e3 /capture.c
parentbe86384b34b8ea02963a335ea05ac186c3eb4b87 (diff)
downloadwireshark-36e13a4c55a5080ae504691c8062f359c3c8668f.tar.gz
Bugfix "Restart the running live capture" when using multiple files makes a long filename. Bug 2274 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2274)
Yes this solution leaks memory, but I think the handful of bytes leaked is worth fixing this nuisance. Won't backport until leak is fixed though. svn path=/trunk/; revision=52793
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/capture.c b/capture.c
index 76882f086a..2131ad683c 100644
--- a/capture.c
+++ b/capture.c
@@ -646,6 +646,13 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
ws_unlink(capture_opts->save_file);
+ /* If we have a ring buffer, the original save file has been overwritten
+ with the "ring filename". Restore it before starting again */
+ if ((capture_opts->multi_files_on) && (capture_opts->orig_save_file != NULL)) {
+ g_free(capture_opts->save_file);
+ capture_opts->save_file = g_strdup(capture_opts->orig_save_file);
+ }
+
/* if it was a tempfile, throw away the old filename (so it will become a tempfile again) */
if(cf_is_tempfile((capture_file *)cap_session->cf)) {
g_free(capture_opts->save_file);