From 5948b0114947460cb60f1de63bdce9ce65d6bbc7 Mon Sep 17 00:00:00 2001 From: "Thierry FOURNIER / OZON.IO" Date: Thu, 24 Nov 2016 23:58:32 +0100 Subject: [PATCH] BUG/MINOR: conf: calloc untested A calloc is executed without check of its returns code. --- src/cfgparse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cfgparse.c b/src/cfgparse.c index a355aa91c..40fd7da76 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4012,6 +4012,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) } rule = calloc(1, sizeof(*rule)); + if (!rule) { + Alert("Out of memory error.\n"); + goto out; + } rule->cond = cond; rule->be.name = strdup(args[1]); LIST_INIT(&rule->list);