summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-01-12 10:15:18 +0000
committerFelix Fietkau <nbd@openwrt.org>2012-01-12 10:15:18 +0000
commit39195e3a25328367918fc1a8b61d769b863da0f8 (patch)
tree80f44b850b26d8a3134c2cdb40dbc5a40da77061
parente87bb77966fcc38b07761c3f627e40cd906faffa (diff)
downloadmtk-20170518-39195e3a25328367918fc1a8b61d769b863da0f8.zip
mtk-20170518-39195e3a25328367918fc1a8b61d769b863da0f8.tar.gz
mtk-20170518-39195e3a25328367918fc1a8b61d769b863da0f8.tar.bz2
libnl-tiny: fix a potential memleak in an error path
SVN-Revision: 29720
-rw-r--r--package/libnl-tiny/src/unl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/package/libnl-tiny/src/unl.c b/package/libnl-tiny/src/unl.c
index 4eb7dc0..71487e0 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;
}