tipc: fix memory leak in tipc_nl_compat_publ_dump
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Sat, 5 Jan 2019 16:52:23 +0000 (10:52 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:35:06 +0000 (15:35 +0100)
commitec5676b5fec3a8940bb694b5dd1ba666f4258cd3
tree3207b2e5b80aa752c2abb61668db9469d5517880
parentd63d0816c2f412394c10a0bd17bb83c7b1c2a3de
tipc: fix memory leak in tipc_nl_compat_publ_dump

[ Upstream commit f87d8ad9233f115db92c6c087d58403b0009ed36 ]

There is a memory leak in case genlmsg_put fails.

Fix this by freeing *args* before return.

Addresses-Coverity-ID: 1476406 ("Resource leak")
Fixes: 46273cf7e009 ("tipc: fix a missing check of genlmsg_put")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tipc/netlink_compat.c