[PATCH] Avoid Potential memory leak.

Purushottam Kushwaha p.kushwaha at samsung.com
Fri Jan 15 03:31:03 PST 2016


Called function [nl80211_ht_vht_overrides()] is not freeing "msg" resource in fail cases.

Signed-off-by: Purushottam Kushwaha <p.kushwaha at samsung.com>
---
 src/drivers/driver_nl80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index cdd1504..5dead25 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -4549,8 +4549,8 @@ retry:
 			goto fail;
 	}
 
-	if (nl80211_ht_vht_overrides(msg, params) < 0)
-		return -1;
+	if ((ret = nl80211_ht_vht_overrides(msg, params)) < 0)
+		goto fail;
 
 	ret = send_and_recv_msgs(drv, msg, NULL, NULL);
 	msg = NULL;
-- 
1.9.1


More information about the Hostap mailing list