[nft PATCH 03/12] rule: Free table->objs in table_free()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes a memory leak identified by valgrind.

Signed-off-by: Phil Sutter <phil@xxxxxx>
---
 src/rule.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/rule.c b/src/rule.c
index c65600364e7d4..3066145747707 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);
-- 
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux