From: xypron.glpk@gmx.de <xypron.glpk@gmx.de>
Date: Wed, 3 May 2017 20:40:11 +0000 (+0200)
Subject: relocate-rela: add missing va_end()
X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d27e35f2564f751a3cc47daa5ab9897f04401a40;p=project%2Fbcm63xx%2Fu-boot.git

relocate-rela: add missing va_end()

va_start must always be matched by va_end.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

diff --git a/tools/relocate-rela.c b/tools/relocate-rela.c
index 3c9d134ac2..df968eb5fd 100644
--- a/tools/relocate-rela.c
+++ b/tools/relocate-rela.c
@@ -27,9 +27,11 @@ static void debug(const char *fmt, ...)
 {
 	va_list args;
 
-	va_start(args, fmt);
-	if (debug_en)
+	if (debug_en) {
+		va_start(args, fmt);
 		vprintf(fmt, args);
+		va_end(args);
+	}
 }
 
 static bool supported_rela(Elf64_Rela *rela)