]> git.ipfire.org Git - people/ms/suricata.git/commit - src/app-layer-ftp.c
Use unlikely for error treatment.
authorEric Leblond <eric@regit.org>
Sun, 23 Sep 2012 13:56:00 +0000 (15:56 +0200)
committerEric Leblond <eric@regit.org>
Tue, 25 Sep 2012 14:24:39 +0000 (16:24 +0200)
commite176be6fcc02e04f8d6acf9afd0933353085e18e
tree9ddd713d293ac67d3d595063cdac9d417db8a6c4
parentd2920048801b68d6075ff9672710c4a1f59e4707
Use unlikely for error treatment.

When handling error case on SCMallog, SCCalloc or SCStrdup
we are in an unlikely case. This patch adds the unlikely()
expression to indicate this to gcc.

This patch has been obtained via coccinelle. The transformation
is the following:

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

x = func(...)
... when != x
- if (x == NULL) S1
+ if (unlikely(x == NULL)) S1
182 files changed:
src/alert-debuglog.c
src/alert-fastlog.c
src/alert-pcapinfo.c
src/alert-prelude.c
src/alert-syslog.c
src/alert-unified2-alert.c
src/app-layer-dcerpc-udp.c
src/app-layer-dcerpc.c
src/app-layer-detect-proto.c
src/app-layer-ftp.c
src/app-layer-htp.c
src/app-layer-parser.c
src/app-layer-smb.c
src/app-layer-smb2.c
src/app-layer-smtp.c
src/app-layer-ssh.c
src/app-layer-ssl.c
src/conf.c
src/cuda-packet-batcher.c
src/decode-ethernet.c
src/decode-events.c
src/decode-gre.c
src/decode-icmpv4.c
src/decode-icmpv6.c
src/decode-ipv4.c
src/decode-ipv6.c
src/decode-ppp.c
src/decode-pppoe.c
src/decode-raw.c
src/decode-tcp.c
src/decode-vlan.c
src/decode.c
src/defrag-hash.c
src/defrag.c
src/detect-ack.c
src/detect-app-layer-event.c
src/detect-asn1.c
src/detect-byte-extract.c
src/detect-bytejump.c
src/detect-bytetest.c
src/detect-content.c
src/detect-csum.c
src/detect-depth.c
src/detect-detection-filter.c
src/detect-distance.c
src/detect-dsize.c
src/detect-engine-address.c
src/detect-engine-event.c
src/detect-engine-iponly.c
src/detect-engine-mpm.c
src/detect-engine-port.c
src/detect-engine-proto.c
src/detect-engine-siggroup.c
src/detect-engine-state.c
src/detect-engine-tag.c
src/detect-engine-threshold.c
src/detect-engine.c
src/detect-fast-pattern.c
src/detect-fileext.c
src/detect-filemagic.c
src/detect-filemd5.c
src/detect-filename.c
src/detect-filesize.c
src/detect-filestore.c
src/detect-flags.c
src/detect-flow.c
src/detect-flowbits.c
src/detect-flowint.c
src/detect-flowvar.c
src/detect-fragbits.c
src/detect-fragoffset.c
src/detect-ftpbounce.c
src/detect-icmp-id.c
src/detect-icmp-seq.c
src/detect-icode.c
src/detect-id.c
src/detect-ipopts.c
src/detect-ipproto.c
src/detect-isdataat.c
src/detect-itype.c
src/detect-l3proto.c
src/detect-luajit.c
src/detect-mark.c
src/detect-msg.c
src/detect-offset.c
src/detect-parse.c
src/detect-pcre.c
src/detect-pktvar.c
src/detect-reference.c
src/detect-replace.c
src/detect-rev.c
src/detect-rpc.c
src/detect-seq.c
src/detect-sid.c
src/detect-ssh-proto-version.c
src/detect-ssh-software-version.c
src/detect-ssl-version.c
src/detect-stream_size.c
src/detect-tag.c
src/detect-threshold.c
src/detect-tls-version.c
src/detect-tls.c
src/detect-tos.c
src/detect-ttl.c
src/detect-uricontent.c
src/detect-urilen.c
src/detect-window.c
src/detect-within.c
src/detect.c
src/flow-alert-sid.c
src/flow-bit.c
src/flow-util.c
src/flow-var.c
src/flow.c
src/host.c
src/log-droplog.c
src/log-file.c
src/log-filestore.c
src/log-httplog.c
src/log-pcap.c
src/log-tlslog.c
src/output.c
src/pkt-var.c
src/runmode-af-packet.c
src/runmode-erf-file.c
src/runmode-napatech.c
src/runmode-pcap-file.c
src/runmode-pcap.c
src/runmode-pfring.c
src/runmodes.c
src/source-af-packet.c
src/source-erf-dag.c
src/source-erf-file.c
src/source-napatech.c
src/source-pcap-file.c
src/source-pcap.c
src/source-pfring.c
src/stream-tcp-inline.c
src/stream-tcp-reassemble.c
src/stream-tcp-sack.c
src/stream-tcp.c
src/stream.c
src/suricata.c
src/tm-queues.c
src/tm-threads.c
src/tmqh-flow.c
src/tmqh-packetpool.c
src/util-bloomfilter-counting.c
src/util-bloomfilter.c
src/util-buffer.c
src/util-cuda-handlers.c
src/util-cuda.c
src/util-debug.c
src/util-decode-asn1.c
src/util-device.c
src/util-file.c
src/util-hash.c
src/util-hashlist.c
src/util-mpm-ac-bs.c
src/util-mpm-ac-gfbs.c
src/util-mpm-ac.c
src/util-mpm-b2g-cuda.c
src/util-mpm-b2g.c
src/util-mpm-b2gc.c
src/util-mpm-b2gm.c
src/util-mpm-b3g.c
src/util-mpm-wumanber.c
src/util-mpm.c
src/util-pool.c
src/util-profiling-rules.c
src/util-profiling.c
src/util-radix-tree.c
src/util-ringbuffer.c
src/util-rohash.c
src/util-runmodes.c
src/util-spm-bm.c
src/util-spm.c
src/util-threshold-config.c
src/util-unittest-helper.c
src/util-unittest.c
src/util-var-name.c
src/win32-misc.c