From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BC804469719 for ; Mon, 21 Sep 2020 08:26:45 +0300 (MSK) From: Sergey Kaplun Date: Mon, 21 Sep 2020 08:26:24 +0300 Message-Id: <20200921052624.9714-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH] cppcheck: src/httpc.c missed va_end() macro List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kirill Yukhin , Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org Found and fixed not closed va_list 'ap' with cppcheck: [src/httpc.c:190]: (error) va_list 'ap' was opened but not closed by va_end(). --- branch: https://github.com/tarantool/tarantool/tree/skaplun/cppcheck-httpc-missed-va-end src/httpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/httpc.c b/src/httpc.c index be73e3684..cb49f6747 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -185,11 +185,11 @@ httpc_set_header(struct httpc_request *req, const char *fmt, ...) va_list ap; va_start(ap, fmt); int rc = vsnprintf(header, MAX_HEADER_LEN + 1, fmt, ap); + va_end(ap); if (rc > MAX_HEADER_LEN) { diag_set(IllegalParams, "header is too large"); return -1; } - va_end(ap); /** * Update flags for automanaged headers: no need to -- 2.28.0