]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: missing free() in function delete_entry()
authorFranz Flasch <franz.flasch@frequentis.com>
Thu, 8 Mar 2012 04:20:41 +0000 (04:20 +0000)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 12 Mar 2012 11:57:57 +0000 (12:57 +0100)
Fixed a memory leak in the dry run path of function delete_entry().

Signed-off-by: Franz Flasch <franz.flasch@frequentis.com>
Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
libiptc/libiptc.c

index 396bc8f5f2338a8a7bc38d48bc281e985850ceb7..13e41d525f28b6bc1cf8aaccdbffc83b96fd7701 100644 (file)
@@ -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