Packet Pool fixes

Fixes the non-TLS crash in autofp mode, where only some Packet Pools are initialized, by checking for initialization on each access and initializing if needed.

Adds calls to PacketPoolDestroy() to cleanup allocated memory.

Passes travis-ci
Thanks. I obviously didn’t check the non-TLS case. Sigh.


From: Victor Julien [mailto:notifications@github.com]
Sent: Wednesday, July 30, 2014 5:56 AM
To: inliniac/suricata
Cc: Kenneth Steele
Subject: Re: [suricata] Packet Pool fixes (#1065)


In src/tmqh-packetpool.c:

>  {

>      TmqhPacketpoolInit();

>

> -    /* Check that the pool is not already created */

> -    PktPool *pool = GetThreadPacketPool();

> -    if (pool)

> -        return pool;

> -

>      /* Create a new pool for this thread. */

>      pool = (PktPool*)SCMallocAligned(sizeof(PktPool), CLS);

I fixed undeclared 'pool' variable here.

—
Reply to this email directly or view it on GitHub<https://github.com/inliniac/suricata/pull/1065/files#r15574878>.