From 0e3614e8f9982c67fa601c8205d8fd4502c9d06f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 4 Apr 2024 00:35:40 +0200 Subject: [PATCH] btrfs-progs: properly close va_copy in fmt_set_unquoted() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by 'gcc -fanalyzer': common/format-output.c:168:1: warning: missing call to ‘va_end’ [-Wanalyzer-va-list-leak] There's a temporary va_list used infmt_set_unquoted() but va_copy() must be paired with va_end(), which is missing. Signed-off-by: David Sterba --- common/format-output.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/format-output.c b/common/format-output.c index 5ddd3f20..3b333ed5 100644 --- a/common/format-output.c +++ b/common/format-output.c @@ -161,8 +161,11 @@ static bool fmt_set_unquoted(struct format_ctx *fctx, const struct rowspec *row, va_copy(tmpargs, args); uuid = va_arg(tmpargs, const u8 *); - if (uuid_is_null(uuid)) + if (uuid_is_null(uuid)) { + va_end(tmpargs); return true; + } + va_end(tmpargs); } return false; }