cb got memory from nl_cb_alloc() but not doing free
during error case and use same lable to go out from function.

Signed-off-by: Amit Khatri <amit.kha...@samsung.com>
Signed-off-by: Rahul Jain <rahul.j...@samsung.com>
---
 iw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/iw.c b/iw.c
index ec56736..a2c2795 100644
--- a/iw.c
+++ b/iw.c
@@ -476,13 +476,13 @@ static int __handle_cmd(struct nl80211_state *state, enum 
id_input idby,

        err = cmd->handler(state, msg, argc, argv, idby);
        if (err)
-               goto out;
+               goto out_free_msg;

        nl_socket_set_cb(state->nl_sock, s_cb);

        err = nl_send_auto_complete(state->nl_sock, msg);
        if (err < 0)
-               goto out;
+               goto out_free_msg;

        err = 1;

@@ -493,9 +493,9 @@ static int __handle_cmd(struct nl80211_state *state, enum 
id_input idby,

        while (err > 0)
                nl_recvmsgs(state->nl_sock, cb);
- out:
-       nl_cb_put(cb);
+
  out_free_msg:
+       nl_cb_put(cb);
        nlmsg_free(msg);
        return err;
  nla_put_failure:
--
1.9.1
N�����r��y����b�X��ǧv�^�)޺{.n�+����{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�m��������zZ+�����ݢj"��!�i

Reply via email to