From: Victor Julien Date: Fri, 1 Aug 2014 07:55:43 +0000 (+0200) Subject: packet pool: init pthread key before using it X-Git-Tag: suricata-2.1beta1~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1083%2Fhead;p=thirdparty%2Fsuricata.git packet pool: init pthread key before using it In the packet pool code, it's critical to initialize the pthread key before using it. Applies only to the code used if __thread isn't supported. --- diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index 4d4f215ac4..16b0abe725 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -265,6 +265,10 @@ void PacketPoolInit(void) { extern intmax_t max_pending_packets; +#ifndef TLS + TmqhPacketPoolInit(); +#endif + PktPool *my_pool = GetThreadPacketPool(); SCMutexInit(&my_pool->return_stack.mutex, NULL);