diff --git a/src/http_act.c b/src/http_act.c index f61362475..0aa8a3759 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -931,6 +931,11 @@ static enum act_parse_ret parse_http_req_capture(const char **args, int *orig_ar cur_arg++; hdr = calloc(1, sizeof(*hdr)); + if (!hdr) { + memprintf(err, "out of memory"); + release_sample_expr(expr); + return ACT_RET_PRS_ERR; + } hdr->next = px->req_cap; hdr->name = NULL; /* not a header capture */ hdr->namelen = 0;