EAP-TTLS: Fix a memory leak on error paths
The allocated challenge needs to be freed on these error paths as well. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
83e003a913
commit
1f2ae8cff5
1 changed files with 2 additions and 0 deletions
|
@ -629,6 +629,7 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm,
|
||||||
wpa_printf(MSG_ERROR,
|
wpa_printf(MSG_ERROR,
|
||||||
"EAP-TTLS/MSCHAP: Failed derive password hash");
|
"EAP-TTLS/MSCHAP: Failed derive password hash");
|
||||||
wpabuf_free(msg);
|
wpabuf_free(msg);
|
||||||
|
os_free(challenge);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,6 +642,7 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm,
|
||||||
wpa_printf(MSG_ERROR,
|
wpa_printf(MSG_ERROR,
|
||||||
"EAP-TTLS/MSCHAP: Failed derive password");
|
"EAP-TTLS/MSCHAP: Failed derive password");
|
||||||
wpabuf_free(msg);
|
wpabuf_free(msg);
|
||||||
|
os_free(challenge);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue