Don't rescan packets when a display filter is added if we are capturing without ...
authorMichael Mann <mmann78@netscape.net>
Sat, 4 Apr 2015 23:24:22 +0000 (19:24 -0400)
committerMichael Mann <mmann78@netscape.net>
Tue, 7 Apr 2015 01:16:26 +0000 (01:16 +0000)
Bug: 6217
Change-Id: Ie4a90ff8a738d6c970d51598bf14b4b51ea069ce
Reviewed-on: https://code.wireshark.org/review/7918
Reviewed-by: Michael Mann <mmann78@netscape.net>
file.c

diff --git a/file.c b/file.c
index bee2adfe30a1947fcd98eb88146c6c4f17f424f5..8dc9a3512230f6d8d07cb844756a6c0de21e2ea0 100644 (file)
--- a/file.c
+++ b/file.c
@@ -1688,6 +1688,9 @@ cf_filter_packets(capture_file *cf, gchar *dftext, gboolean force)
   cf->dfilter = dftext;
   g_get_current_time(&start_time);
 
+  /* if we are capturing without displaying packets, there is nothing to filter */
+  if (cf->frames == NULL)
+    return CF_ERROR;
 
   /* Now rescan the packet list, applying the new filter, but not
      throwing away information constructed on a previous pass. */