From 1ad7e163fad45d33a44f398fb2416f1b9086469a Mon Sep 17 00:00:00 2001 From: Danijel Tasov Date: Fri, 6 Oct 2023 10:54:20 +0200 Subject: check malloc diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 274277b..197ce32 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -758,6 +758,10 @@ main(int argc, char **argv) host = list; table = malloc(sizeof(struct rta_host *) * targets); + if(!table) { + crash("main(): malloc failed for host table"); + return 3; + } i = 0; while(host) { -- cgit v0.10-9-g596f