From: Kamil Dudka Date: Thu, 3 Jul 2014 18:19:35 +0000 (+0200) Subject: tool: call PL_ArenaFinish() on exit if NSPR is used X-Git-Tag: curl-7_37_1~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d343033f3d26bfbc1a1ee90db48a43763aaed264;p=thirdparty%2Fcurl.git 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 --- diff --git a/src/tool_main.c b/src/tool_main.c index dc980e00c0..b815726c0a 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);