]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-PEAP peer: Fix a memory leak on an error path
authorJouni Malinen <j@w1.fi>
Sun, 20 Dec 2015 14:55:28 +0000 (16:55 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 20 Dec 2015 15:25:41 +0000 (17:25 +0200)
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>
src/eap_peer/eap_peap.c

index 164ac267c8172d2f9593c15e2c97b2f9110bcd4f..503d4b02d09952069787e9d527fc56209b02120c 100644 (file)
@@ -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);