From: Jason Ish Date: Thu, 8 Feb 2024 19:21:11 +0000 (-0600) Subject: detect-http: add superfluous alloc check for cocci X-Git-Tag: suricata-7.0.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a846ff76d45b2cf428b40404ec53f609f015d585;p=thirdparty%2Fsuricata.git detect-http: add superfluous alloc check for cocci 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. (cherry picked from commit f800ed0f901488d19fccf858ba0711792bf407ff) --- diff --git a/src/detect-http-header.c b/src/detect-http-header.c index 2803d05a5c..0d4b3d6e52 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -600,6 +600,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; }