Skip to content

Commit

Permalink
detect-http: add superfluous alloc check for cocci
Browse files Browse the repository at this point in the history
Add not-needed SCCalloc return check to satisfy our Cocci malloc
checks as it can't see that the caller immediately checks the return
value of this simple wrapper around SCCalloc.
  • Loading branch information
jasonish committed Feb 8, 2024
1 parent 80abc22 commit d3cc5d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/detect-http-header.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,11 @@ typedef struct HttpMultiBufHeaderThreadData {
static void *HttpMultiBufHeaderThreadDataInit(void *data)
{
HttpMultiBufHeaderThreadData *td = SCCalloc(1, sizeof(*td));

/* This return value check to satisfy our Cocci malloc checks. */
if (td == NULL) {
return NULL;
}
return td;
}

Expand Down

0 comments on commit d3cc5d8

Please sign in to comment.