From: Jouni Malinen Date: Sun, 20 Dec 2015 14:55:28 +0000 (+0200) Subject: EAP-PEAP peer: Fix a memory leak on an error path X-Git-Tag: hostap_2_6~1146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f5c86e7bdaf11472aa15f504d1e9337d9a0a10f;p=thirdparty%2Fhostap.git EAP-PEAP peer: Fix a memory leak on an error path If memory allocation for adding SoH response fails, the SoH response was not freed properly on the error path. Signed-off-by: Jouni Malinen --- diff --git a/src/eap_peer/eap_peap.c b/src/eap_peer/eap_peap.c index 164ac267c..503d4b02d 100644 --- a/src/eap_peer/eap_peap.c +++ b/src/eap_peer/eap_peap.c @@ -646,6 +646,7 @@ static int eap_peap_phase2_request(struct eap_sm *sm, if (*resp == NULL) { ret->methodState = METHOD_DONE; ret->decision = DECISION_FAIL; + wpabuf_free(buf); return -1; } wpabuf_put_buf(*resp, buf);