From: Jouni Malinen Date: Tue, 31 Mar 2015 13:17:48 +0000 (+0300) Subject: TLS: Fix memory leaks on tls_connection_set_params() error paths X-Git-Tag: hostap_2_5~882 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4b45c60addcc5f1f919b8401b1ae05a51f7d9f0;p=thirdparty%2Fhostap.git TLS: Fix memory leaks on tls_connection_set_params() error paths The internal TLS implementation started rejecting number of unsupported configuration parameters recently, but those new error paths did not free the allocated tlsv1_credentials buffer. Signed-off-by: Jouni Malinen --- diff --git a/src/crypto/tls_internal.c b/src/crypto/tls_internal.c index 19a2d5a99..afd46953f 100644 --- a/src/crypto/tls_internal.c +++ b/src/crypto/tls_internal.c @@ -192,26 +192,31 @@ int tls_connection_set_params(void *tls_ctx, struct tls_connection *conn, if (params->subject_match) { wpa_printf(MSG_INFO, "TLS: subject_match not supported"); + tlsv1_cred_free(cred); return -1; } if (params->altsubject_match) { wpa_printf(MSG_INFO, "TLS: altsubject_match not supported"); + tlsv1_cred_free(cred); return -1; } if (params->suffix_match) { wpa_printf(MSG_INFO, "TLS: suffix_match not supported"); + tlsv1_cred_free(cred); return -1; } if (params->domain_match) { wpa_printf(MSG_INFO, "TLS: domain_match not supported"); + tlsv1_cred_free(cred); return -1; } if (params->openssl_ciphers) { - wpa_printf(MSG_INFO, "GnuTLS: openssl_ciphers not supported"); + wpa_printf(MSG_INFO, "TLS: openssl_ciphers not supported"); + tlsv1_cred_free(cred); return -1; }