]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Use PacketGetfromAlloc() for packet allocation instead of SCMalloc.
authorKen Steele <ken@tilera.com>
Fri, 17 May 2013 14:05:04 +0000 (10:05 -0400)
committerVictor Julien <victor@inliniac.net>
Tue, 21 May 2013 16:30:12 +0000 (18:30 +0200)
Only changed in one file for testing.

src/app-layer-detect-proto.c

index bd5ebd41ac090fa8f79448bf668567e2ea9f09d7..03ee632e0f0439322a0f8da7c7542a6a9ed9e8a0 100644 (file)
@@ -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;