From d343033f3d26bfbc1a1ee90db48a43763aaed264 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Thu, 3 Jul 2014 20:19:35 +0200 Subject: tool: call PL_ArenaFinish() on exit if NSPR is used This prevents valgrind from reporting still reachable memory allocated by NSPR arenas (mainly the freelist). Reported-by: Hubert Kario --- src/tool_main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tool_main.c b/src/tool_main.c index dc980e00c..b815726c0 100644 --- a/src/tool_main.c +++ b/src/tool_main.c @@ -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); -- cgit v1.2.3