From: Thierry FOURNIER / OZON.IO Date: Thu, 24 Nov 2016 22:58:32 +0000 (+0100) Subject: BUG/MINOR: conf: calloc untested X-Git-Tag: v1.7.0~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5948b0114947460cb60f1de63bdce9ce65d6bbc7;p=thirdparty%2Fhaproxy.git BUG/MINOR: conf: calloc untested A calloc is executed without check of its returns code. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index a355aa91cf..40fd7da76f 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);