]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-SIM/AKA server: Fix memory leak in error path
authorJouni Malinen <j@w1.fi>
Sun, 11 Nov 2012 11:15:49 +0000 (13:15 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Nov 2012 11:15:49 +0000 (13:15 +0200)
If identity round limit is reached, EAP-SIM/AKA session is terminated.
This needs to free the allocated message.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/eap_server/eap_server_aka.c
src/eap_server/eap_server_sim.c

index a965cac49070d0c3f32517678228ce43471ceded..177b58dac52f17e95c2047688f4299298cf72a63 100644 (file)
@@ -365,6 +365,7 @@ static struct wpabuf * eap_aka_build_identity(struct eap_sm *sm,
                eap_sim_msg_add(msg, EAP_SIM_AT_ANY_ID_REQ, 0, NULL, 0);
        } else if (data->identity_round > 3) {
                /* Cannot use more than three rounds of Identity messages */
+               eap_sim_msg_free(msg);
                return NULL;
        } else if (sm->identity && sm->identity_len > 0 &&
                   (sm->identity[0] == EAP_AKA_REAUTH_ID_PREFIX ||
index f83c3cbff9a8aaca5b185b9fe4eb12405a9d15aa..b531241e84e1f79bf1f1daf5672b378c4e194757 100644 (file)
@@ -117,6 +117,7 @@ static struct wpabuf * eap_sim_build_start(struct eap_sm *sm,
                eap_sim_msg_add(msg, EAP_SIM_AT_ANY_ID_REQ, 0, NULL, 0);
        } else if (data->start_round > 3) {
                /* Cannot use more than three rounds of Start messages */
+               eap_sim_msg_free(msg);
                return NULL;
        } else if (data->start_round == 0) {
                /*