[PATCH v2 2/2] hostapd: free nlmsg when radar detection fail
Janusz Dziedzic
janusz.dziedzic
Sat Sep 27 21:54:44 PDT 2014
Remove poswsible memory leak when start radar
detection will fail.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic at tieto.com>
---
src/drivers/driver_nl80211.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 682ec68..26e31a3 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -11527,11 +11527,13 @@ static int nl80211_start_radar_detection(void *priv,
goto nla_put_failure;
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+ msg = NULL;
if (ret == 0)
return 0;
wpa_printf(MSG_DEBUG, "nl80211: Failed to start radar detection: "
"%d (%s)", ret, strerror(-ret));
nla_put_failure:
+ nlmsg_free(msg);
return -1;
}
--
1.9.1
More information about the Hostap
mailing list