Skip to contentSkip to conversation

nft: Remove memory-leak

PATCH Superseded Piyush Pangtey 2 participants 2 messages Mar 14, 2016 – Mar 15, 2016 netfilter

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nft: Remove memory-leak

Added matching xfree calls in chain_free(), for the chain members 'type' and 'dev'.

---
 src/rule.c | 3 +++
 1 file changed, 3 insertions(+)
src/rule.c +3 -0
index 0b78549..85987b9 100644
@@ -510,6 +510,9 @@ void chain_free(struct chain *chain)
 		rule_free(rule);
 	handle_free(&chain->handle);
 	scope_release(&chain->scope);
+	xfree(chain->type);
+	if (chain->dev != NULL)
+		xfree(chain->dev);
 	xfree(chain);
 }
 
Signature · 7 lines
1.9.1


-- 

With regards,
Piyush Pangtey <[email protected]>
#1 lore raw
Quoted 2 lines · Piyush Pangtey

Added matching xfree calls in chain_free(), for the chain members 'type' and 'dev'.

Please, reintroduce the valgrind message for the record.

It would be good too if you add to the descriptions the nft command you use to trigger the valgrind leak reports.

Thanks.