From 35f44734bcada32bde56981d070e522b68c1b4dd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 30 Apr 2014 14:29:46 +0200 Subject: [PATCH] act: fix memory leak in rtnl_act_parse() Acked-by: Cong Wang Signed-off-by: Thomas Haller --- lib/route/act.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/route/act.c b/lib/route/act.c index f5733bb..0e5d7d1 100644 --- a/lib/route/act.c +++ b/lib/route/act.c @@ -384,6 +384,7 @@ void rtnl_act_put_all(struct rtnl_act **head) int rtnl_act_parse(struct rtnl_act **head, struct nlattr *tb) { + struct rtnl_act *act; struct rtnl_tc_ops *ops; struct nlattr *tb2[TCA_ACT_MAX + 1]; struct nlattr *nla[TCA_ACT_MAX_PRIO + 1]; @@ -396,7 +397,6 @@ int rtnl_act_parse(struct rtnl_act **head, struct nlattr *tb) return err; for (i = 0; i < TCA_ACT_MAX_PRIO && nla[i]; i++) { - struct rtnl_act *act; struct rtnl_tc *tc; act = rtnl_act_alloc(); @@ -447,6 +447,7 @@ int rtnl_act_parse(struct rtnl_act **head, struct nlattr *tb) return 0; err_free: + rtnl_act_put (act); rtnl_act_put_all(head); return err;