1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

openssl: fix memory leak of SSLKEYLOGFILE filename

- Free the copy of SSLKEYLOGFILE env returned by curl_getenv during ossl
  initialization.

Caught by ASAN.
This commit is contained in:
Jay Satiro 2018-01-03 15:22:41 -05:00
parent 272613df02
commit 129390a518

View File

@ -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