diff --git a/src/proxy.c b/src/proxy.c index ce60df0bd..079280c9c 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -756,6 +756,10 @@ static int proxy_parse_declare(char **args, int section, struct proxy *curpx, /* register the capture. */ hdr = calloc(1, sizeof(*hdr)); + if (!hdr) { + memprintf(err, "proxy '%s': out of memory while registering a capture", curpx->id); + return -1; + } hdr->name = NULL; /* not a header capture */ hdr->namelen = 0; hdr->len = len;