]> git.itanic.dy.fi Git - linux-stable/commit
tools: ynl: don't leak mcast_groups on init error
authorJakub Kicinski <kuba@kernel.org>
Tue, 20 Feb 2024 16:11:12 +0000 (08:11 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 22 Feb 2024 01:02:28 +0000 (17:02 -0800)
commit5d78b73e851455d525a064f3b042b29fdc0c1a4a
tree5d6678d660aa4a4b3d341cbf42692124e281e845
parente4fe082c38cd74a8fa384bc7542cf3edf1cb7318
tools: ynl: don't leak mcast_groups on init error

Make sure to free the already-parsed mcast_groups if
we don't get an ack from the kernel when reading family info.
This is part of the ynl_sock_create() error path, so we won't
get a call to ynl_sock_destroy() to free them later.

Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://lore.kernel.org/r/20240220161112.2735195-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/ynl.c