From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp56.i.mail.ru (smtp56.i.mail.ru [217.69.128.36]) (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 EDB13469719 for ; Tue, 22 Sep 2020 08:04:20 +0300 (MSK) Date: Tue, 22 Sep 2020 08:04:00 +0300 From: Sergey Kaplun Message-ID: <20200922050400.GA9277@root> References: <20200921052624.9714-1-skaplun@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200921052624.9714-1-skaplun@tarantool.org> Subject: Re: [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 On 21.09.20, Sergey Kaplun wrote: > 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 > Since we don't have 'cppcheck' subsystem, I've changed it to 'httpc'. I've updated commit message to: ``` httpc: src/httpc.c missed va_end() macro 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(). ``` and pushed it to the branch. -- Best regards, Sergey Kaplun