From 0e7adc21a64cc07f463311883c77a50d4bac15e7 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 21 Oct 2022 20:54:24 +0200 Subject: [PATCH] decode: alloc packets using calloc --- src/decode.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/decode.c b/src/decode.c index 102087b89f..3ffb7a54f4 100644 --- a/src/decode.c +++ b/src/decode.c @@ -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;