From: Victor Julien Date: Fri, 21 Apr 2023 08:21:17 +0000 (+0200) Subject: stream: fix minor scan-build warning X-Git-Tag: suricata-7.0.0-rc2~371 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c151144502f262caaab40d74e4a4e8d485d38e5;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. --- diff --git a/src/stream-tcp.c b/src/stream-tcp.c index cc516c2a1b..c1fa6c55f1 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -130,7 +130,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); @@ -139,7 +139,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);