Browse Source

EAP-LEAP: Fix possible memory leak in eap_leap_process_request()

Free 'resp' object in case of a failure to derive the response.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Ilan Peer 7 years ago
parent
commit
96e595a9f1
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/eap_peer/eap_leap.c

+ 1 - 0
src/eap_peer/eap_leap.c

@@ -120,6 +120,7 @@ static struct wpabuf * eap_leap_process_request(struct eap_sm *sm, void *priv,
 	     nt_challenge_response(challenge, password, password_len, rpos))) {
 		wpa_printf(MSG_DEBUG, "EAP-LEAP: Failed to derive response");
 		ret->ignore = TRUE;
+		wpabuf_free(resp);
 		return NULL;
 	}
 	os_memcpy(data->peer_response, rpos, LEAP_RESPONSE_LEN);