]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect-http: add superfluous alloc check for cocci
authorJason Ish <jason.ish@oisf.net>
Thu, 8 Feb 2024 19:21:11 +0000 (13:21 -0600)
committerVictor Julien <victor@inliniac.net>
Fri, 9 Feb 2024 10:24:04 +0000 (11:24 +0100)
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

index 98e438c21111d552ca5b0fc477c1c571b2eb2450..7c15bf094a765607ce7060dc2a27a1e081c2483e 100644 (file)
@@ -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;
 }