]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix memory leak inside register_mgmt_frame
authorJohn Crispin <john@phrozen.org>
Fri, 17 May 2019 19:29:50 +0000 (21:29 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 May 2019 08:44:25 +0000 (10:44 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
mgmt.c

diff --git a/mgmt.c b/mgmt.c
index 60f544b0b1c1b5a1f4c273e973d68fea70ad0361..88fe3fd25b2d3dee0f8fc4359bdce17dbddf06a3 100644 (file)
--- a/mgmt.c
+++ b/mgmt.c
@@ -69,9 +69,11 @@ static int register_mgmt_frame(struct nl80211_state *state,
        NLA_PUT_U16(msg, NL80211_ATTR_FRAME_TYPE, type);
        NLA_PUT(msg, NL80211_ATTR_FRAME_MATCH, match_len, match);
 
+       free(match);
        return 0;
 
 nla_put_failure:
+       free(match);
        return -ENOBUFS;
 }