From 79b075365f2af08e2db7f290bee6353f5950f79b Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 20 Jan 2021 09:07:18 +0000 Subject: [PATCH] Don't dereference a known-to-be-null pointer. In dump_dfilter_macro_t(), if the dfilter_macro_t pointer is null, just give up after printing the message that indicates that. This should squelch several nullPointerRedundantCheck warnings from cppcheck. (cherry picked from commit 05b9e5377753cb7463294bf17f3f2cc6faec6ba4) --- epan/dfilter/dfilter-macro.c | 1 + 1 file changed, 1 insertion(+) diff --git a/epan/dfilter/dfilter-macro.c b/epan/dfilter/dfilter-macro.c index 385c8b39ed..fbc819f092 100644 --- a/epan/dfilter/dfilter-macro.c +++ b/epan/dfilter/dfilter-macro.c @@ -612,6 +612,7 @@ void dump_dfilter_macro_t(const dfilter_macro_t *m, const char *function, const if(m == NULL) { ws_debug_printf(" dfilter_macro_t * == NULL! (via: %s(): %s:%d)\n", function, file, line); ws_debug_printf("\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); + return; } ws_debug_printf("DUMP of dfilter_macro_t: %p (via: %s(): %s:%d)\n", m, function, file, line);