From: Philippe Antoine Date: Tue, 15 Mar 2022 19:59:28 +0000 (+0100) Subject: tmqh: fix possible null dereference X-Git-Tag: suricata-7.0.0-beta1~802 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68fa0800692a224cafd2ecd72f79b24ef820c2f5;p=thirdparty%2Fsuricata.git tmqh: fix possible null dereference Coverity ID: 1502953 As we check just on the next line my_pool against NULL, we should not dereference it, even for debug validation --- diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index 3b84f36081..3ca5d87c0b 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -338,7 +338,7 @@ void PacketPoolDestroy(void) PktPool *my_pool = GetThreadPacketPool(); #ifdef DEBUG_VALIDATION - BUG_ON(my_pool->destroyed); + BUG_ON(my_pool && my_pool->destroyed); #endif /* DEBUG_VALIDATION */ if (my_pool && my_pool->pending_pool != NULL) {