瀏覽代碼

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>
xypron.glpk@gmx.de 7 年之前
父節點
當前提交
d27e35f256
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      tools/relocate-rela.c

+ 4 - 2
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)