]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-stats: fix memleak
authorEric Leblond <eric@regit.org>
Fri, 4 Mar 2016 18:36:43 +0000 (19:36 +0100)
committerEric Leblond <eric@regit.org>
Mon, 7 Mar 2016 22:29:58 +0000 (23:29 +0100)
This fixes:

16 bytes in 2 blocks are definitely lost in loss record 69 of 319
   at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x85955D: OutputStatsLogThreadInit (output-stats.c:118)
   by 0x4CAE13: StatsMgmtThread (counters.c:352)
   by 0x68DE283: start_thread (pthread_create.c:333)
   by 0x80A6A4C: clone (in /lib/x86_64-linux-gnu/libc-2.21.so)

src/output-stats.c

index a6752fc5b7aee2186b690c641556fcd68c3ae899..8309755de62c48e862648f1860f5d36cb9d095b4 100644 (file)
@@ -186,6 +186,8 @@ static TmEcode OutputStatsLogThreadDeinit(ThreadVars *tv, void *thread_data)
         store = next_store;
         logger = logger->next;
     }
+
+    SCFree(op_thread_data);
     return TM_ECODE_OK;
 }