From 1f1e599b3bfb667f05a859afb723984cd7d4a04a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 15 Feb 2016 21:53:33 +0200 Subject: [PATCH] OpenSSL: Fix memory leak on error path If SSL_CTX_new(SSLv23_method()) fails, tls_init() error path did not free the allocated struct tls_data instance. Signed-off-by: Jouni Malinen --- src/crypto/tls_openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c index e34a3d075..e53b1b641 100644 --- a/src/crypto/tls_openssl.c +++ b/src/crypto/tls_openssl.c @@ -941,6 +941,7 @@ void * tls_init(const struct tls_config *conf) os_free(tls_global); tls_global = NULL; } + os_free(data); return NULL; } data->ssl = ssl;