defrag: free defrag tree at exit

This fixes:

72 bytes in 3 blocks are definitely lost in loss record 153 of 316
   at 0x4C29C0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x9AF041: SCRadixCreateRadixTree (util-radix-tree.c:430)
   by 0x50FF5D: DefragPolicyLoadFromConfig (defrag-config.c:138)
   by 0x5129F5: DefragInit (defrag.c:962)
   by 0x87ECFD: UnixSocketPcapFilesCheck (runmode-unix-socket.c:386)
   by 0x90FEC0: UnixCommandBackgroundTasks (unix-manager.c:430)
   by 0x913C6D: UnixManager (unix-manager.c:980)
   by 0x9072F3: 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)
pull/1910/head
Eric Leblond 10 years ago
parent 55a8f3ce1d
commit d367750633

@ -160,3 +160,11 @@ void DefragPolicyLoadFromConfig(void)
}
}
}
void DefragTreeDestroy(void)
{
if (defrag_tree != NULL) {
SCRadixReleaseRadixTree(defrag_tree);
}
defrag_tree = NULL;
}

@ -28,5 +28,6 @@
void DefragSetDefaultTimeout(intmax_t timeout);
void DefragPolicyLoadFromConfig(void);
int DefragPolicyGetHostTimeout(Packet *p);
void DefragTreeDestroy(void);
#endif /* DEFRAG_CONFIG_H_ */

@ -978,6 +978,7 @@ void DefragDestroy(void)
DefragHashShutdown();
DefragContextDestroy(defrag_context);
defrag_context = NULL;
DefragTreeDestroy();
}
#ifdef UNITTESTS

Loading…
Cancel
Save