summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2018-01-03 15:22:41 -0500
committerJay Satiro <raysatiro@yahoo.com>2018-01-03 15:22:41 -0500
commit129390a518c41739364081c8966a718f2ac347a4 (patch)
tree5e9b91eca442e4bc58acb91b1bd27e78723e4eaa
parent272613df020c29a445738856dda29a9803b9bedb (diff)
downloadcurl-129390a518c41739364081c8966a718f2ac347a4.tar.gz
openssl: fix memory leak of SSLKEYLOGFILE filename
- Free the copy of SSLKEYLOGFILE env returned by curl_getenv during ossl initialization. Caught by ASAN.
-rw-r--r--lib/vtls/openssl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 6d9e81d3b..89f873342 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -904,7 +904,7 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size)
static int Curl_ossl_init(void)
{
#ifdef ENABLE_SSLKEYLOGFILE
- const char *keylog_file_name;
+ char *keylog_file_name;
#endif
OPENSSL_load_builtin_modules();
@@ -957,6 +957,7 @@ static int Curl_ossl_init(void)
keylog_file_fp = NULL;
}
}
+ Curl_safefree(keylog_file_name);
}
#endif