From 2fa8e25d0d35757d234a9f93463a64f64134b3d8 Mon Sep 17 00:00:00 2001 From: nbd Date: Thu, 12 Jan 2012 10:15:18 +0000 Subject: [PATCH] libnl-tiny: fix a potential memleak in an error path git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29720 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/libnl-tiny/src/unl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package/libnl-tiny/src/unl.c b/package/libnl-tiny/src/unl.c index 4eb7dc07f..71487e0c1 100644 --- a/package/libnl-tiny/src/unl.c +++ b/package/libnl-tiny/src/unl.c @@ -191,11 +191,11 @@ static int unl_genl_multicast_id(struct unl *unl, const char *name) NLA_PUT_STRING(msg, CTRL_ATTR_FAMILY_NAME, unl->family_name); unl_genl_request_single(unl, msg, &msg); if (!msg) - goto nla_put_failure; + return -1; groups = unl_find_attr(unl, msg, CTRL_ATTR_MCAST_GROUPS); if (!groups) - goto fail; + goto nla_put_failure; nla_for_each_nested(group, groups, rem) { const char *gn; @@ -215,9 +215,8 @@ static int unl_genl_multicast_id(struct unl *unl, const char *name) break; } -fail: - nlmsg_free(msg); nla_put_failure: + nlmsg_free(msg); return ret; } -- 2.20.1