From f7b062fad0a1cd7d89fa97a9074b3381671e8dc5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sun, 7 Jan 2001 06:55:24 +0000 Subject: Revert malloc. Why? --- iptables-standalone.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'iptables-standalone.c') diff --git a/iptables-standalone.c b/iptables-standalone.c index 102c0f39..b891e974 100644 --- a/iptables-standalone.c +++ b/iptables-standalone.c @@ -35,21 +35,14 @@ main(int argc, char *argv[]) { int ret; char *table = "filter"; - iptc_handle_t *handle; - - handle = (iptc_handle_t *) malloc(sizeof(iptc_handle_t)); - if (!handle) { - fprintf(stderr, "out of memory\n"); - exit(1); - } - memset(handle, 0, sizeof(iptc_handle_t)); + iptc_handle_t handle = NULL; program_name = "iptables"; program_version = NETFILTER_VERSION; - ret = do_command(argc, argv, &table, handle); + ret = do_command(argc, argv, &table, &handle); if (ret) - ret = iptc_commit(handle); + ret = iptc_commit(&handle); if (!ret) fprintf(stderr, "iptables: %s\n", -- cgit v1.2.3