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 05b9e53777)
This commit is contained in:
Guy Harris 2021-01-20 09:07:18 +00:00
parent 886465a976
commit 79b075365f
1 changed files with 1 additions and 0 deletions

View File

@ -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);