]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-TTLS: Fix a memory leak on error paths
authorJouni Malinen <j@w1.fi>
Sat, 8 Jul 2017 13:21:01 +0000 (16:21 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 8 Jul 2017 13:21:38 +0000 (16:21 +0300)
The allocated challenge needs to be freed on these error paths as well.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_peer/eap_ttls.c

index c8a05fdcaff812e4d1cc726ec85d8b3a7686ed7b..f18788ce8cb5c86b57b0fc2af2424a39d8c6c20a 100644 (file)
@@ -629,6 +629,7 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm,
                        wpa_printf(MSG_ERROR,
                                   "EAP-TTLS/MSCHAP: Failed derive password hash");
                        wpabuf_free(msg);
+                       os_free(challenge);
                        return -1;
                }
 
@@ -641,6 +642,7 @@ static int eap_ttls_phase2_request_mschap(struct eap_sm *sm,
                        wpa_printf(MSG_ERROR,
                                   "EAP-TTLS/MSCHAP: Failed derive password");
                        wpabuf_free(msg);
+                       os_free(challenge);
                        return -1;
                }