summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2018-04-13 16:52:26 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-04-14 13:53:02 +0200
commit438dddb2146f21c971e552753c7e9488e3c8b193 (patch)
tree56107a9983c6a0c7f52b22a781b4b88e179a6d48
parent6e4bbbb278a50e61b6c219680004e7bd4480137c (diff)
rule: Free table->objs in table_free()
This fixes a memory leak identified by valgrind. Signed-off-by: Phil Sutter <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/rule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index c6560036..30661457 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -812,6 +812,7 @@ void table_free(struct table *table)
{
struct chain *chain, *next;
struct set *set, *nset;
+ struct obj *obj, *nobj;
if (--table->refcnt > 0)
return;
@@ -819,6 +820,8 @@ void table_free(struct table *table)
chain_free(chain);
list_for_each_entry_safe(set, nset, &table->sets, list)
set_free(set);
+ list_for_each_entry_safe(obj, nobj, &table->objs, list)
+ obj_free(obj);
handle_free(&table->handle);
scope_release(&table->scope);
xfree(table);