]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
decode: alloc packets using calloc
authorVictor Julien <vjulien@oisf.net>
Fri, 21 Oct 2022 18:54:24 +0000 (20:54 +0200)
committerVictor Julien <vjulien@oisf.net>
Tue, 25 Oct 2022 08:39:10 +0000 (10:39 +0200)
src/decode.c

index 102087b89f1d450bfc218254b8a99493e25e4345..3ffb7a54f4fd29bc54cc0b6910aafefed27bc41d 100644 (file)
@@ -171,12 +171,10 @@ void PacketUpdateEngineEventCounters(ThreadVars *tv,
  */
 Packet *PacketGetFromAlloc(void)
 {
-    Packet *p = SCMalloc(SIZE_OF_PACKET);
+    Packet *p = SCCalloc(1, SIZE_OF_PACKET);
     if (unlikely(p == NULL)) {
         return NULL;
     }
-
-    memset(p, 0, SIZE_OF_PACKET);
     PacketInit(p);
     p->ReleasePacket = PacketFree;