From 61b8f7ecb64b3b6fe04d2a6ad9598f66e42ceea8 Mon Sep 17 00:00:00 2001 From: Franz Flasch Date: Thu, 8 Mar 2012 04:20:41 +0000 Subject: iptables: missing free() in function delete_entry() Fixed a memory leak in the dry run path of function delete_entry(). Signed-off-by: Franz Flasch Signed-off-by: Christian Engelmayer Signed-off-by: Pablo Neira Ayuso --- libiptc/libiptc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c index 396bc8f5..13e41d52 100644 --- a/libiptc/libiptc.c +++ b/libiptc/libiptc.c @@ -1993,8 +1993,10 @@ static int delete_entry(const IPT_CHAINLABEL chain, const STRUCT_ENTRY *origfw, continue; /* if we are just doing a dry run, we simply skip the rest */ - if (dry_run) + if (dry_run){ + free(r); return 1; + } /* If we are about to delete the rule that is the * current iterator, move rule iterator back. next -- cgit v1.2.3