From 8b8e26b33304c56370096cecbe58fdb3ede318c2 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Tue, 5 Feb 2013 13:03:02 +0100 Subject: link: Fix af_ops leak on ENOMEM Signed-off-by: Thomas Graf --- lib/route/link.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit v0.12