summaryrefslogtreecommitdiffstats
path: root/ip6tables-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 /ip6tables-restore.c
parente4ba10e9607f7b7b6a42ac71d98e770af51c89bd (diff)
fix memory leak(s) in libiptc. Reverts the previous (wrong) patch. (Martin Josefsson)
Diffstat (limited to 'ip6tables-restore.c')
-rw-r--r--ip6tables-restore.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index 82e1d2b..ecda870 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -7,7 +7,7 @@
* Rusty Russell <rusty@linuxcare.com.au>
* This code is distributed under the terms of GNU GPL v2
*
- * $Id: ip6tables-restore.c,v 1.10 2002/08/14 11:40:41 laforge Exp $
+ * $Id: ip6tables-restore.c,v 1.11 2003/03/05 07:46:15 laforge Exp $
*/
#include <getopt.h>
@@ -102,7 +102,7 @@ static void free_argv(void) {
int main(int argc, char *argv[])
{
- ip6tc_handle_t handle;
+ ip6tc_handle_t handle = NULL;
char buffer[10240];
int c;
char curtable[IP6T_TABLE_MAXNAMELEN + 1];
@@ -183,6 +183,9 @@ int main(int argc, char *argv[])
}
strncpy(curtable, table, IP6T_TABLE_MAXNAMELEN);
+ if (handle)
+ ip6tc_free(&handle);
+
handle = create_handle(table, modprobe);
if (noflush == 0) {
DEBUGP("Cleaning all chains of table '%s'\n",