From: Victor Julien Date: Tue, 6 Jan 2015 09:22:37 +0000 (+0100) Subject: packet pool: make pending pool use more robust X-Git-Tag: suricata-2.1beta3~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1286%2Fhead;p=thirdparty%2Fsuricata.git packet pool: make pending pool use more robust Don't leave pointers dangling. --- diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index bd8761e25a..6ef25c7d32 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -254,6 +254,9 @@ void PacketPoolReturnPacket(Packet *p) SCMutexUnlock(&pool->return_stack.mutex); /* Clear the list of pending packets to return. */ my_pool->pending_pool = NULL; + my_pool->pending_head = NULL; + my_pool->pending_tail = NULL; + my_pool->pending_count = 0; } } else { /* Push onto return stack for this pool */ @@ -297,7 +300,7 @@ void PacketPoolDestroy(void) { Packet *p = NULL; PktPool *my_pool = GetThreadPacketPool(); - if (my_pool && my_pool->pending_head != NULL) { + if (my_pool && my_pool->pending_pool != NULL) { p = my_pool->pending_head; while (p) { Packet *next_p = p->next;