]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Revert malloc. Why?
authorRusty Russell <rusty@linuxcare.com.au>
Sun, 7 Jan 2001 06:55:24 +0000 (06:55 +0000)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 7 Jan 2001 06:55:24 +0000 (06:55 +0000)
iptables-standalone.c

index 102c0f39811758a97d207186197e2276123266ab..b891e974bd888fbaa90d2123a4bde7b03ee415c7 100644 (file)
@@ -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",