From 68fa0800692a224cafd2ecd72f79b24ef820c2f5 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 15 Mar 2022 20:59:28 +0100 Subject: [PATCH] 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 --- src/tmqh-packetpool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {