From a846ff76d45b2cf428b40404ec53f609f015d585 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 8 Feb 2024 13:21:11 -0600 Subject: [PATCH] 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) --- src/detect-http-header.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.47.2