]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix s_cb leak
authorJohannes Berg <johannes.berg@intel.com>
Fri, 18 Sep 2015 08:44:44 +0000 (10:44 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 Sep 2015 08:44:44 +0000 (10:44 +0200)
Reported-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw.c

diff --git a/iw.c b/iw.c
index ec5673619559243d11885e9bed3e708f550677ab..0f511d98f2e1e151648a14aa7d830ce995964716 100644 (file)
--- a/iw.c
+++ b/iw.c
@@ -454,7 +454,7 @@ static int __handle_cmd(struct nl80211_state *state, enum id_input idby,
        if (!cb || !s_cb) {
                fprintf(stderr, "failed to allocate netlink callbacks\n");
                err = 2;
-               goto out_free_msg;
+               goto out;
        }
 
        genlmsg_put(msg, 0, 0, state->nl80211_id, 0,
@@ -495,7 +495,7 @@ static int __handle_cmd(struct nl80211_state *state, enum id_input idby,
                nl_recvmsgs(state->nl_sock, cb);
  out:
        nl_cb_put(cb);
- out_free_msg:
+       nl_cb_put(s_cb);
        nlmsg_free(msg);
        return err;
  nla_put_failure: