Commit 6c95e2a2 authored by Niko Jokinen's avatar Niko Jokinen Committed by John W. Linville

nl80211: Memory leak fixed

Potential memory leak via msg pointer in nl80211_get_key() function.
Signed-off-by: default avatarNiko Jokinen <ext-niko.k.jokinen@nokia.com>
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3da7429c
...@@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
if (IS_ERR(hdr)) { if (IS_ERR(hdr)) {
err = PTR_ERR(hdr); err = PTR_ERR(hdr);
goto out; goto free_msg;
} }
cookie.msg = msg; cookie.msg = msg;
...@@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
&cookie, get_key_callback); &cookie, get_key_callback);
if (err) if (err)
goto out; goto free_msg;
if (cookie.error) if (cookie.error)
goto nla_put_failure; goto nla_put_failure;
...@@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info) ...@@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
nla_put_failure: nla_put_failure:
err = -ENOBUFS; err = -ENOBUFS;
free_msg:
nlmsg_free(msg); nlmsg_free(msg);
out: out:
cfg80211_put_dev(drv); cfg80211_put_dev(drv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment