diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-07-25 11:08:04 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-07-25 18:09:16 +0000 |
commit | 4a498ae7982a1234ab5584b02de93c99fb89f9fe (patch) | |
tree | b6f34893f2328953bc840f4140bdc6576f86dab7 | |
parent | 3071af2550621f18253da61f96e07aa7649c1067 (diff) |
Don't remove a tap listener we didn't find in the first place.
If remove_tap_listener() doesn't find a tap listener with the specified
data, print a warning message and skip the "remove the tap listener"
steps.
This means that the internal free_tap_listener() won't be called with a
null listener; remove the now-unnecessary check (if anybody *does* call
it with a null pointer, that's a bug).
This prevents the crash in bug 15006, but that now produces a warning
message; it doesn't fix the underlying bug, it just changes the symptom.
Change-Id: Ia9a2bfa3d57b86eac0d6e0b0bad03a7b81e254e3
Ping-Bug: 15006
Reviewed-on: https://code.wireshark.org/review/28853
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | epan/tap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/tap.c b/epan/tap.c index f71652da38..c0b1dbf629 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -449,8 +449,6 @@ find_tap_id(const char *name) static void free_tap_listener(volatile tap_listener_t *tl) { - if(!tl) - return; dfilter_free(tl->code); g_free(tl->fstring); DIAG_OFF(cast-qual) @@ -615,6 +613,10 @@ remove_tap_listener(void *tapdata) } } + if(!tl) { + ws_g_warning("remove_tap_listener(): no listener found with that tap data"); + return; + } } if(tl->finish) tl->finish(tapdata); |