summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2014-07-02 16:34:48 +0200
committerKamil Dudka <kdudka@redhat.com>2014-07-02 18:11:05 +0200
commit24c3cdce88f39731506c287cb276e8bf4a1ce393 (patch)
treeaf9e9b74e8ea4040944b6e2312ad661a8ae2eb12
parent7581dee10aedeb96231dd24e187ff5426fc72469 (diff)
downloadgnurl-24c3cdce88f39731506c287cb276e8bf4a1ce393.tar.gz
gnurl-24c3cdce88f39731506c287cb276e8bf4a1ce393.tar.bz2
gnurl-24c3cdce88f39731506c287cb276e8bf4a1ce393.zip
tool: call PR_Cleanup() on exit if NSPR is used
This prevents valgrind from reporting possibly lost memory that NSPR uses for file descriptor cache and other globally allocated internal data structures.
-rw-r--r--RELEASE-NOTES1
-rw-r--r--src/tool_main.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 66b43066f..5e7c3c13e 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -36,6 +36,7 @@ This release includes the following bugfixes:
o Curl_rand: Use a fake entropy for debug builds when CURL_ENTROPY set
o nss: do not abort on connection failure (failing tests 305 and 404)
o nss: make the fallback to SSLv3 work again
+ o tool: prevent valgrind from reporting possibly lost memory (nss only)
o
This release includes the following known bugs:
diff --git a/src/tool_main.c b/src/tool_main.c
index ef96dc3a4..dc980e00c 100644
--- a/src/tool_main.c
+++ b/src/tool_main.c
@@ -27,6 +27,10 @@
#include <signal.h>
#endif
+#ifdef USE_NSS
+#include <nspr.h>
+#endif
+
#define ENABLE_CURLX_PRINTF
/* use our own printf() functions */
#include "curlx.h"
@@ -205,6 +209,11 @@ static void main_free(struct GlobalConfig *config)
curl_global_cleanup();
convert_cleanup();
metalink_cleanup();
+#ifdef USE_NSS
+ if(PR_Initialized())
+ /* prevent valgrind from reporting possibly lost memory (fd cache, ...) */
+ PR_Cleanup();
+#endif
free_config_fields(config);
/* Free the config structures */