Code

check_host: Allocate a large-enough buffer for the host table.
[nagiosplug.git] / plugins-root / check_icmp.c
index 6d8ba09980a141848e2c21d6441ec4c9aa1617ce..fe8fc56f81b0650600fe6bfca97d5d7a20ef54d3 100644 (file)
@@ -621,7 +621,7 @@ main(int argc, char **argv)
        }
 
        host = list;
-       table = malloc(sizeof(struct rta_host **) * (argc - 1));
+       table = malloc(sizeof(struct rta_host **) * targets);
        i = 0;
        while(host) {
                host->id = i*packets;