From e7aeab3063ac5645136303278b477d7de35266c0 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 20 May 2019 11:11:39 +0530 Subject: across: clang-scan: fix NULL dereferencing warnings All these checks are done after analyzing clang-scan report produced by the CI job @ https://build.gluster.org/job/clang-scan updates: bz#1622665 Change-Id: I590305af4ceb779be952974b2a36066ffc4865ca Signed-off-by: Amar Tumballi --- libglusterfs/src/logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index f0fb9a097da..32d98e932e6 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -1873,7 +1873,7 @@ _gf_msg_internal(const char *domain, const char *file, const char *function, if (size == 0) { flush_logged_msg = _gf_true; goto unlock; - } else if ((ctx->log.lru_cur_size + 1) > size) { + } else if (((ctx->log.lru_cur_size + 1) > size) && (first)) { /* If the list is full, flush the lru msg to disk and also * release it after unlock, and ... * */ -- cgit