relocate-rela: add missing va_end()
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Wed, 3 May 2017 20:40:11 +0000 (22:40 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 5 May 2017 20:45:57 +0000 (16:45 -0400)
va_start must always be matched by va_end.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
tools/relocate-rela.c

index 3c9d134..df968eb 100644 (file)
@@ -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)