summaryrefslogtreecommitdiffstats
path: root/libiptc/libiptc.c
diff options
context:
space:
mode:
authorTomáš Lejdar <tomas.lejdar@i.cz>2003-04-30 15:57:01 +0000
committerHarald Welte <laforge@gnumonks.org>2003-04-30 15:57:01 +0000
commit23a6b4564bc6edecd888530b461093586842acbf (patch)
treed007c7b91553ccd96a321bda8ce96dc49202ac3b /libiptc/libiptc.c
parented30c6bd6f4e9745468b095fbf8b1d0bd9844114 (diff)
Fix libiptc memory hole during iptc_chain_next() (Tomas Lejdar)
Diffstat (limited to 'libiptc/libiptc.c')
-rw-r--r--libiptc/libiptc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 985b9b0d..55b708b8 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -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;
}