summaryrefslogtreecommitdiffstats
path: root/iptables-restore.c
diff options
context:
space:
mode:
authorlaforge <laforge>2003-05-02 15:30:11 +0000
committerlaforge <laforge>2003-05-02 15:30:11 +0000
commit3785261a19bc2be523f288ba032f78f0b02bccdd (patch)
tree9f7a208076fc164ca3d52e745964c7dbc7afc350 /iptables-restore.c
parente4ba10e9607f7b7b6a42ac71d98e770af51c89bd (diff)
fix memory leak(s) in libiptc. Reverts the previous (wrong) patch. (Martin Josefsson)
Diffstat (limited to 'iptables-restore.c')
-rw-r--r--iptables-restore.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/iptables-restore.c b/iptables-restore.c
index 74f7db3..c1888ce 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -4,7 +4,7 @@
*
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: iptables-restore.c,v 1.24 2003/03/03 08:08:37 laforge Exp $
+ * $Id: iptables-restore.c,v 1.25 2003/03/06 11:56:31 laforge Exp $
*/
#include <getopt.h>
@@ -99,7 +99,7 @@ static void free_argv(void) {
int main(int argc, char *argv[])
{
- iptc_handle_t handle;
+ iptc_handle_t handle = NULL;
char buffer[10240];
int c;
char curtable[IPT_TABLE_MAXNAMELEN + 1];
@@ -180,6 +180,9 @@ int main(int argc, char *argv[])
}
strncpy(curtable, table, IPT_TABLE_MAXNAMELEN);
+ if (handle)
+ iptc_free(&handle);
+
handle = create_handle(table, modprobe);
if (noflush == 0) {
DEBUGP("Cleaning all chains of table '%s'\n",