aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2014-07-03 20:19:35 +0200
committerKamil Dudka <kdudka@redhat.com>2014-07-03 20:27:20 +0200
commitd343033f3d26bfbc1a1ee90db48a43763aaed264 (patch)
tree33f570d9678c38fd24751731454eb10d22595431 /src
parent22eb00f9378af4d5b128119754d1b4d69b81e2ee (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/tool_main.c5
1 files changed, 4 insertions, 1 deletions
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);