]> 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)
committerShivani Bhardwaj <shivanib134@gmail.com>
Fri, 9 Feb 2024 14:11:32 +0000 (19:41 +0530)
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

index 2803d05a5cfd715f1358539a36668f13e4e3a3f8..0d4b3d6e52b5712ed6f5bde7bdd282ce91c59e74 100644 (file)
@@ -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;
 }