From 1ad7e163fad45d33a44f398fb2416f1b9086469a Mon Sep 17 00:00:00 2001 From: Danijel Tasov Date: Fri, 6 Oct 2023 10:54:20 +0200 Subject: check malloc --- plugins-root/check_icmp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 274277b7..197ce32f 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 v1.2.3-74-g34f1