Skip to content

Commit

Permalink
nl80211: Memory leak fixed
Browse files Browse the repository at this point in the history
Potential memory leak via msg pointer in nl80211_get_key() function.

Signed-off-by: Niko Jokinen <ext-niko.k.jokinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Niko Jokinen authored and John W. Linville committed Jul 21, 2009
1 parent 3da7429 commit 6c95e2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)

if (IS_ERR(hdr)) {
err = PTR_ERR(hdr);
goto out;
goto free_msg;
}

cookie.msg = msg;
Expand All @@ -1011,7 +1011,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
&cookie, get_key_callback);

if (err)
goto out;
goto free_msg;

if (cookie.error)
goto nla_put_failure;
Expand All @@ -1022,6 +1022,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)

nla_put_failure:
err = -ENOBUFS;
free_msg:
nlmsg_free(msg);
out:
cfg80211_put_dev(drv);
Expand Down

0 comments on commit 6c95e2a

Please sign in to comment.