summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2013-02-05 12:03:02 (GMT)
committerThomas Graf <tgraf@suug.ch>2013-02-05 12:03:02 (GMT)
commit8b8e26b33304c56370096cecbe58fdb3ede318c2 (patch)
treec48186241c2e28227fb973a9c203fe3d70ceb0e9 /lib
parent506020ae99377ce45992d225e3b2917ee7b45b77 (diff)
downloadlibnl-8b8e26b33304c56370096cecbe58fdb3ede318c2.zip
libnl-8b8e26b33304c56370096cecbe58fdb3ede318c2.tar.gz
libnl-8b8e26b33304c56370096cecbe58fdb3ede318c2.tar.bz2
link: Fix af_ops leak on ENOMEM
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib')
-rw-r--r--lib/route/link.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/route/link.c b/lib/route/link.c
index 8b5227e..e395529 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -72,8 +72,10 @@ static struct rtnl_link_af_ops *af_lookup_and_alloc(struct rtnl_link *link,
if (!af_ops)
return NULL;
- if (!(data = rtnl_link_af_alloc(link, af_ops)))
+ if (!(data = rtnl_link_af_alloc(link, af_ops))) {
+ rtnl_link_af_ops_put(af_ops);
return NULL;
+ }
return af_ops;
}