From: Johannes Berg Date: Fri, 18 Sep 2015 08:44:44 +0000 (+0200) Subject: iw: fix s_cb leak X-Git-Tag: v4.3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7faa1ba1cf7be97002b2db2033f420b59a060476;p=thirdparty%2Fiw.git iw: fix s_cb leak Reported-by: Amit Khatri Signed-off-by: Johannes Berg --- diff --git a/iw.c b/iw.c index ec56736..0f511d9 100644 --- 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: