diff --git a/src/tcp_rules.c b/src/tcp_rules.c index 2e1eac4ee..edc287b56 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -1055,6 +1055,10 @@ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx, } rule = calloc(1, sizeof(*rule)); + if (!rule) { + memprintf(err, "parsing [%s:%d] : out of memory", file, line); + return -1; + } LIST_INIT(&rule->list); arg = 1; where = 0; @@ -1169,6 +1173,10 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, } rule = calloc(1, sizeof(*rule)); + if (!rule) { + memprintf(err, "parsing [%s:%d] : out of memory", file, line); + return -1; + } LIST_INIT(&rule->list); arg = 1; where = 0;