From: Jay Satiro Date: Wed, 3 Jan 2018 20:22:41 +0000 (-0500) Subject: openssl: fix memory leak of SSLKEYLOGFILE filename X-Git-Tag: curl-7_58_0~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=129390a518c41739364081c8966a718f2ac347a4;p=thirdparty%2Fcurl.git openssl: fix memory leak of SSLKEYLOGFILE filename - Free the copy of SSLKEYLOGFILE env returned by curl_getenv during ossl initialization. Caught by ASAN. --- diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 6d9e81d3b7..89f873342c 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