From: Victor Julien Date: Fri, 21 Oct 2022 18:54:24 +0000 (+0200) Subject: decode: alloc packets using calloc X-Git-Tag: suricata-7.0.0-beta1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e7adc21a64cc07f463311883c77a50d4bac15e7;p=thirdparty%2Fsuricata.git decode: alloc packets using calloc --- 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;