]> git.ipfire.org Git - thirdparty/suricata.git/commit
tm-queue: unify queue name handling
authorEric Leblond <eric@regit.org>
Fri, 4 Mar 2016 18:13:43 +0000 (19:13 +0100)
committerEric Leblond <eric@regit.org>
Mon, 7 Mar 2016 22:28:47 +0000 (23:28 +0100)
commitde6a37f17bf6be9628564486c1625a7aa55c22ca
tree8947e2b2445f79655cc0d6e9f0e09380b1ea7bfe
parentf34fe85cfedc68e5c5c06a0d699d99b1e9616197
tm-queue: unify queue name handling

Queue name was sometimes allocated and sometimes not. This
patch updates the behavior of creation function so it is
always allocated. This way we can free it at exit and fix
memory leak.

This fixes:

900 bytes in 110 blocks are definitely lost in loss record 322 of 329
   at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x803E0A9: strdup (in /lib/x86_64-linux-gnu/libc-2.21.so)
   by 0x90090E: StoreQueueId (tmqh-flow.c:112)
   by 0x8FFEA8: TmqhOutputFlowSetupCtx (tmqh-flow.c:180)
   by 0x908C7F: TmThreadCreate (tm-threads.c:1095)
   by 0x909982: TmThreadCreatePacketHandler (tm-threads.c:1154)
   by 0x87906F: RunModeFilePcapAutoFp (runmode-pcap-file.c:188)
   by 0x88376B: RunModeDispatch (runmodes.c:372)
   by 0x87F245: UnixSocketPcapFilesCheck (runmode-unix-socket.c:393)
   by 0x9102B0: UnixCommandBackgroundTasks (unix-manager.c:430)
   by 0x91405D: UnixManager (unix-manager.c:980)
   by 0x907773: TmThreadsManagement (tm-threads.c:600)

tm-queue: fix logic WIP
src/tm-queues.c
src/tmqh-flow.c