From 3f48274d0ebce7a8fbbe0ac0e73da8d6d2cdff70 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 22 Feb 2016 19:34:06 +0200 Subject: [PATCH] WNM: Fix a memory leak on AP error path If the second memory allocation in ieee802_11_send_wnmsleep_resp() were to fail and ieee80211_11_get_tfs_ie() succeed, the wnmtfs_ie allocation would not have been freed on the error path. Signed-off-by: Jouni Malinen --- src/ap/wnm_ap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c index 6af460ab7..41d50cebf 100644 --- a/src/ap/wnm_ap.c +++ b/src/ap/wnm_ap.c @@ -95,6 +95,7 @@ static int ieee802_11_send_wnmsleep_resp(struct hostapd_data *hapd, if (mgmt == NULL) { wpa_printf(MSG_DEBUG, "MLME: Failed to allocate buffer for " "WNM-Sleep Response action frame"); + os_free(wnmtfs_ie); return -1; } os_memcpy(mgmt->da, addr, ETH_ALEN);