config-test: fix memory leak detect by ASAN

NSS library was not deinit at exit resulting in memory leak. As
it is useless for a config test, the patch updates the code so it
is not initialized.

Patch also calls MagicDeinit to free memory used by libmagic.
pull/2069/head
Eric Leblond 10 years ago committed by Victor Julien
parent bf551ace4e
commit e29e9056cb

@ -2353,10 +2353,13 @@ static int PostConfLoadedSetup(SCInstance *suri)
if (InitSignalHandler(suri) != TM_ECODE_OK)
SCReturnInt(TM_ECODE_FAILED);
#ifdef HAVE_NSS
/* init NSS for md5 */
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
NSS_NoDB_Init(NULL);
if (suri->run_mode != RUNMODE_CONF_TEST) {
/* init NSS for md5 */
PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
NSS_NoDB_Init(NULL);
}
#endif
if (suri->disabled_detect) {
@ -2536,6 +2539,7 @@ int main(int argc, char **argv)
if (suri.run_mode == RUNMODE_CONF_TEST){
SCLogNotice("Configuration provided was successfully loaded. Exiting.");
MagicDeinit();
exit(EXIT_SUCCESS);
}

Loading…
Cancel
Save