From: Ben Date: Mon, 19 Jan 2015 01:44:38 +0000 (-0500) Subject: EAP: Fix possible memory leak in eap_ttls_process_decrypted() X-Git-Tag: hostap_2_4~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bd02739314d483ed0f583feef8081092ca5a5ca;p=thirdparty%2Fhostap.git EAP: Fix possible memory leak in eap_ttls_process_decrypted() In case eap_peer_tls_encrypt() fails in eap_ttls_process_decrypted(), free resp memory. Signed-off-by: Ben Rosenfeld --- diff --git a/src/eap_peer/eap_ttls.c b/src/eap_peer/eap_ttls.c index 6fbc27b71..b5c028b52 100644 --- a/src/eap_peer/eap_ttls.c +++ b/src/eap_peer/eap_ttls.c @@ -995,6 +995,7 @@ static int eap_ttls_encrypt_response(struct eap_sm *sm, resp, out_data)) { wpa_printf(MSG_INFO, "EAP-TTLS: Failed to encrypt a Phase 2 " "frame"); + wpabuf_free(resp); return -1; } wpabuf_free(resp);