diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-02-18 12:52:21 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-02-18 20:52:52 +0000 |
commit | 0347538758f29b056c2e04959539bdc32f0291b6 (patch) | |
tree | 09f6d7185a4840a586fc2a4ffa4a8c9dacbe4e44 /tfshark.c | |
parent | da861e431135c620a879358b32731125b3e7b495 (diff) |
Don't start command-line taps until we've opened a file.
We shouldn't do so until we have something on which to compute
statistics and until we're in file scope, as the taps may use
file-scoped memory, given that statistics pertain to a file.
Change-Id: I08b6e5ed145d7a25056857cc570f383f5116d6ce
Reviewed-on: https://code.wireshark.org/review/25889
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tfshark.c')
-rw-r--r-- | tfshark.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -878,11 +878,6 @@ main(int argc, char *argv[]) line that their preferences have changed. */ prefs_apply_all(); - /* At this point MATE will have registered its field array so we can - have a tap filter with one of MATE's late-registered fields as part - of the filter. We can now process all the "-z" arguments. */ - start_requested_stats(); - /* * Enabled and disabled protocols and heuristic dissectors as per * command-line options. @@ -958,6 +953,14 @@ main(int argc, char *argv[]) goto clean_exit; } + /* Start statistics taps; we do so after successfully opening the + capture file, so we know we have something to compute stats + on, and after registering all dissectors, so that MATE will + have registered its field array so we can have a tap filter + with one of MATE's late-registered fields as part of the + filter. */ + start_requested_stats(); + /* Process the packets in the file */ TRY { /* XXX - for now there is only 1 packet */ |