]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix libiptc memory hole during iptc_chain_next() (Tomas Lejdar)
authorTomáš Lejdar <tomas.lejdar@i.cz>
Wed, 30 Apr 2003 15:57:01 +0000 (15:57 +0000)
committerHarald Welte <laforge@gnumonks.org>
Wed, 30 Apr 2003 15:57:01 +0000 (15:57 +0000)
libiptc/libiptc.c

index 985b9b0d1ef020e4deff2e612b2c9ede63716f77..55b708b8053a39871c67ddd6dfd003809821efff 100644 (file)
@@ -1,4 +1,4 @@
-/* Library which manipulates firewall rules.  Version $Revision: 1.34 $ */
+/* Library which manipulates firewall rules.  Version $Revision: 1.35 $ */
 
 /* Architecture of firewall rules is as follows:
  *
@@ -504,8 +504,10 @@ TC_NEXT_CHAIN(TC_HANDLE_T *handle)
        (*handle)->cache_chain_iteration++;
 
        if ((*handle)->cache_chain_iteration - (*handle)->cache_chain_heads
-           == (*handle)->cache_num_chains)
+           == (*handle)->cache_num_chains) {
+               free((*handle)->cache_chain_heads);
                return NULL;
+       }
 
        return (*handle)->cache_chain_iteration->name;
 }