From f800ed0f901488d19fccf858ba0711792bf407ff 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. --- 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 98e438c211..7c15bf094a 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -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; } -- 2.47.2