return err;
}
+static void reset_xtables(void)
+{
+ /*
+ * We need also to free the memory implicitly allocated
+ * during parsing (see xtables_options_xfrm()).
+ * Note xt_params is actually iptables_globals.
+ */
+ if (xt_params->opts != xt_params->orig_opts) {
+ g_free(xt_params->opts);
+ xt_params->opts = xt_params->orig_opts;
+ }
+ xt_params->option_offset = 0;
+}
+
static void cleanup_parse_context(struct parse_context *ctx)
{
g_strfreev(ctx->argv);
target_name, ctx->xt_t, ctx->xt_rm);
out:
cleanup_parse_context(ctx);
+ reset_xtables();
return err;
}
ctx->xt_rm);
out:
cleanup_parse_context(ctx);
+ reset_xtables();
return err;
}
DBG("");
g_hash_table_destroy(table_hash);
-
- xtables_free_opts(1);
}