]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
tmqh-flow: fix memleak in TmqhFlowCtx cleaning
authorEric Leblond <eric@regit.org>
Fri, 4 Mar 2016 18:33:25 +0000 (19:33 +0100)
committerEric Leblond <eric@regit.org>
Mon, 7 Mar 2016 22:29:58 +0000 (23:29 +0100)
This fixes:

96 bytes in 4 blocks are definitely lost in loss record 178 of 320
   at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x8FF88C: TmqhOutputFlowSetupCtx (tmqh-flow.c:163)
   by 0x908D5F: TmThreadCreate (tm-threads.c:1097)
   by 0x909A62: TmThreadCreatePacketHandler (tm-threads.c:1156)
   by 0x8790CF: RunModeFilePcapAutoFp (runmode-pcap-file.c:188)
   by 0x8837CB: RunModeDispatch (runmodes.c:372)
   by 0x87F2A5: UnixSocketPcapFilesCheck (runmode-unix-socket.c:393)
   by 0x910460: UnixCommandBackgroundTasks (unix-manager.c:430)
   by 0x91420D: UnixManager (unix-manager.c:980)
   by 0x907853: TmThreadsManagement (tm-threads.c:602)
   by 0x68DE283: start_thread (pthread_create.c:333)
   by 0x80A6A4C: clone (in /lib/x86_64-linux-gnu/libc-2.21.so)

src/tmqh-flow.c

index 6ea8917bdba225b524ad1de805686d37d98a0721..a1ec839bcfbec930ad6fffb9d0ced249a2de2d98 100644 (file)
@@ -217,6 +217,7 @@ void TmqhOutputFlowFreeCtx(void *ctx)
     }
 
     SCFree(fctx->queues);
+    SCFree(fctx);
 
     return;
 }