Skip to content

Commit

Permalink
tool: call PL_ArenaFinish() on exit if NSPR is used
Browse files Browse the repository at this point in the history
This prevents valgrind from reporting still reachable memory allocated
by NSPR arenas (mainly the freelist).

Reported-by: Hubert Kario
  • Loading branch information
kdudka committed Jul 3, 2014
1 parent 22eb00f commit d343033
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tool_main.c
Expand Up @@ -210,9 +210,12 @@ static void main_free(struct GlobalConfig *config)
convert_cleanup();
metalink_cleanup();
#ifdef USE_NSS
if(PR_Initialized())
if(PR_Initialized()) {
/* prevent valgrind from reporting still reachable mem from NSRP arenas */
PL_ArenaFinish();
/* prevent valgrind from reporting possibly lost memory (fd cache, ...) */
PR_Cleanup();
}
#endif
free_config_fields(config);

Expand Down

0 comments on commit d343033

Please sign in to comment.