mirror of
https://github.com/curl/curl.git
synced 2026-07-24 16:27:17 +03:00
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.
This commit is contained in:
parent
7581dee10a
commit
24c3cdce88
2 changed files with 10 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue