mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-29 14:55:12 +00:00
nl80211: fix possible memory leak nl80211_connect()
connkeys is malloced in nl80211_parse_connkeys() and should be freed in the error handling case, otherwise it will cause memory leak. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
3d2abdfdf1
commit
b4e4f47e94
@ -5633,8 +5633,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
|
||||
sizeof(connect.ht_capa_mask));
|
||||
|
||||
if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) {
|
||||
if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK])
|
||||
if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) {
|
||||
kfree(connkeys);
|
||||
return -EINVAL;
|
||||
}
|
||||
memcpy(&connect.ht_capa,
|
||||
nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]),
|
||||
sizeof(connect.ht_capa));
|
||||
|
Loading…
x
Reference in New Issue
Block a user