Parcourir la source

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 <j@w1.fi>
Jouni Malinen il y a 9 ans
Parent
commit
4f5c86e7bd
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      src/eap_peer/eap_peap.c

+ 1 - 0
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);