OSDN Git Service

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>
Tue, 3 Dec 2019 21:26:13 +0000 (22:26 +0100)
commit07a322292a8a46471d97c2fa01f122a7e1737953
treea6360fc24dc8d2110e040a685607e224ddb31812
parentca215ae2d7e66e9ce4e956186e8d2541f15066af
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