]> git.ipfire.org Git - thirdparty/suricata.git/commit
Use unlikely in malloc failure test. 604/head
authorEric Leblond <eric@regit.org>
Mon, 28 Oct 2013 10:49:23 +0000 (11:49 +0100)
committerEric Leblond <eric@regit.org>
Mon, 28 Oct 2013 10:49:23 +0000 (11:49 +0100)
commit79fcf1378a84964663a4873f23349f8198fe2b8e
tree3d8634895c378a73c7a4e508bd7b41ce2022bc5d
parentc8b3f4418affd9135ef1103694b0d907531e0d13
Use unlikely in malloc failure test.

This patch is a result of applying the following coccinelle
transformation to suricata sources:

  @istested@
  identifier x;
  statement S1;
  identifier func =~ "(SCMalloc|SCStrdup|SCCalloc|SCMallocAligned|SCRealloc)";
  @@

  x = func(...)
  ... when != x
  - if (x == NULL) S1
  + if (unlikely(x == NULL)) S1
24 files changed:
src/app-layer-dns-common.c
src/app-layer-htp.c
src/app-layer-parser.c
src/detect-content.c
src/detect-engine-hcbd.c
src/detect-engine-hhd.c
src/detect-engine-mpm.c
src/detect-luajit-extensions.c
src/flow-storage.c
src/host-storage.c
src/runmode-tile.c
src/source-mpipe.c
src/source-napatech.c
src/stream-tcp.c
src/util-cuda-buffer.c
src/util-cuda-handlers.c
src/util-cuda.c
src/util-magic.c
src/util-mpm-ac-tile.c
src/util-mpm.c
src/util-pool-thread.c
src/util-runmodes.c
src/util-storage.c
src/util-threshold-config.c