]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
packet pool: init pthread key before using it 1083/head
authorVictor Julien <victor@inliniac.net>
Fri, 1 Aug 2014 07:55:43 +0000 (09:55 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 1 Aug 2014 07:55:43 +0000 (09:55 +0200)
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.

src/tmqh-packetpool.c

index 4d4f215ac4c46ff443923331800ef350440c0a35..16b0abe725b7ec9ccfacec2e8d19ecad1f8c40f8 100644 (file)
@@ -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);