From: Ken Steele Date: Fri, 17 May 2013 14:05:04 +0000 (-0400) Subject: Use PacketGetfromAlloc() for packet allocation instead of SCMalloc. X-Git-Tag: suricata-2.0beta1~135 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=394f99e32c26a69f483cb171569bef1d8284ba21;p=thirdparty%2Fsuricata.git Use PacketGetfromAlloc() for packet allocation instead of SCMalloc. Only changed in one file for testing. --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index bd5ebd41ac..03ee632e0f 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2007-2010 Open Information Security Foundation +/* Copyright (C) 2007-2013 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -412,11 +412,9 @@ uint16_t AppLayerDetectGetProtoPMParser(AlpProtoDetectCtx *ctx, &tdir->pmq, buf, searchlen); #else - Packet *p = SCMalloc(SIZE_OF_PACKET); + Packet *p = PacketGetFromAlloc(); if (unlikely(p == NULL)) goto end; - memset(p, 0, SIZE_OF_PACKET); - p->pkt = (uint8_t *)(p + 1); p->cuda_done = 0; p->cuda_free_packet = 1;