From: Victor Julien Date: Fri, 21 Apr 2023 08:21:17 +0000 (+0200) Subject: stream: fix minor scan-build warning X-Git-Tag: suricata-6.0.12~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc0886d39d39b72a74255dbe113926df3e533175;p=thirdparty%2Fsuricata.git stream: fix minor scan-build warning stream-tcp.c:134:14: warning: Value stored to 'presize' during its initialization is never read [deadcode.DeadStores] uint64_t presize = SC_ATOMIC_GET(st_memuse); ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. (cherry picked from commit 0c151144502f262caaab40d74e4a4e8d485d38e5) --- diff --git a/src/stream-tcp.c b/src/stream-tcp.c index c63e4ec2a6..1555cbdd09 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -137,7 +137,7 @@ void StreamTcpIncrMemuse(uint64_t size) void StreamTcpDecrMemuse(uint64_t size) { -#ifdef DEBUG_VALIDATION +#if defined(DEBUG_VALIDATION) && defined(UNITTESTS) uint64_t presize = SC_ATOMIC_GET(st_memuse); if (RunmodeIsUnittests()) { BUG_ON(presize > UINT_MAX); @@ -146,7 +146,7 @@ void StreamTcpDecrMemuse(uint64_t size) (void) SC_ATOMIC_SUB(st_memuse, size); -#ifdef DEBUG_VALIDATION +#if defined(DEBUG_VALIDATION) && defined(UNITTESTS) if (RunmodeIsUnittests()) { uint64_t postsize = SC_ATOMIC_GET(st_memuse); BUG_ON(postsize > presize);