diff mbox

nft: Remove memory-leak

Message ID 20160314084153.GA4064@fate
State Changes Requested
Delegated to: Pablo Neira
Headers show

Commit Message

Piyush Pangtey March 14, 2016, 8:41 a.m. UTC
Added matching xfree calls in chain_free(), for the chain members 'type' and
'dev'.

Signed-off-by: Piyush Pangtey <gokuvsvegita@gmail.com>
---
 src/rule.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Pablo Neira Ayuso March 15, 2016, 12:26 a.m. UTC | #1
On Mon, Mar 14, 2016 at 02:11:53PM +0530, Piyush Pangtey wrote:
> 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.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/rule.c b/src/rule.c
index 0b78549..85987b9 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -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);
 }