[PATCH 1/2] act: fix memory leak in rtnl_act_parse()
Thomas Haller
thaller at redhat.com
Wed Apr 30 05:29:46 PDT 2014
Signed-off-by: Thomas Haller <thaller at redhat.com>
---
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 1e9673f..2157cf3 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;
--
1.9.0
More information about the libnl
mailing list