tipc: fix a memory leak in tipc_nl_node_get_link()
authorCong Wang <xiyou.wangcong@gmail.com>
Wed, 10 Jan 2018 20:50:25 +0000 (12:50 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Jan 2018 18:45:50 +0000 (13:45 -0500)
commit59b36613e85fb16ebf9feaf914570879cd5c2a21
tree9219f64c5110f0f7b4865420b154e649cca774e5
parent749439bfac6e1a2932c582e2699f91d329658196
tipc: fix a memory leak in tipc_nl_node_get_link()

When tipc_node_find_by_name() fails, the nlmsg is not
freed.

While on it, switch to a goto label to properly
free it.

Fixes: be9c086715c ("tipc: narrow down exposure of struct tipc_node")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/node.c