* [PATCH net-next] cfg80211: fix possible memory leak in regdb_query_country()
@ 2018-03-30 2:07 Wei Yongjun
0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2018-03-30 2:07 UTC (permalink / raw)
To: Johannes Berg; +Cc: Wei Yongjun, linux-wireless, kernel-janitors
'wmm_ptrs' is malloced in regdb_query_country() and should be freed
before leaving from the error handling cases, otherwise it will cause
memory leak.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
net/wireless/reg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 16c7e4e..ac3e12c 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1026,6 +1026,7 @@ static int regdb_query_country(const struct fwdb_header *db,
if (!tmp_rd) {
kfree(regdom);
+ kfree(wmm_ptrs);
return -ENOMEM;
}
regdom = tmp_rd;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-03-30 2:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 2:07 [PATCH net-next] cfg80211: fix possible memory leak in regdb_query_country() Wei Yongjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).