From a3be79a14202b9a79e81e41596d8b5d013ef5257 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 19 Apr 2019 17:08:27 +0300 Subject: [PATCH] EAP-GPSK server: Fix memory freeing on error path Allocated struct wpabuf was freed with incorrect freeing function. Fix this by using the appropriate function. Signed-off-by: Jouni Malinen --- src/eap_server/eap_server_gpsk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eap_server/eap_server_gpsk.c b/src/eap_server/eap_server_gpsk.c index fb3d11748..bebb17f40 100644 --- a/src/eap_server/eap_server_gpsk.c +++ b/src/eap_server/eap_server_gpsk.c @@ -181,7 +181,7 @@ static struct wpabuf * eap_gpsk_build_gpsk_3(struct eap_sm *sm, if (eap_gpsk_compute_mic(data->sk, data->sk_len, data->vendor, data->specifier, start, pos - start, pos) < 0) { - os_free(req); + wpabuf_free(req); eap_gpsk_state(data, FAILURE); return NULL; } @@ -379,7 +379,7 @@ static void eap_gpsk_process_gpsk_2(struct eap_sm *sm, data->specifier = WPA_GET_BE16(csuite->specifier); wpa_printf(MSG_DEBUG, "EAP-GPSK: CSuite_Sel %d:%d", data->vendor, data->specifier); - pos += sizeof(*csuite); + pos += sizeof(*csuite); if (end - pos < 2) { wpa_printf(MSG_DEBUG, "EAP-GPSK: Too short message for "