mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 06:49:25 +00:00
tools: fix variable argument list read without ending with va_end
va_end() was not getting called under certain condition after the va_start() function call taking the va_list Tracked-On: #3406 Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com> Acked-by: Gang Chen <gang.c.chen@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
21083ee09c
commit
c0cb9c509f
@@ -36,11 +36,11 @@ static void loginfo(int fd, const char *fmt, ...)
|
||||
|
||||
va_start(ap, fmt);
|
||||
len = vasprintf(&buf, fmt, ap);
|
||||
va_end(ap);
|
||||
if (len == -1) {
|
||||
LOGE("write to buf failed\n");
|
||||
return;
|
||||
}
|
||||
va_end(ap);
|
||||
|
||||
ret = write(fd, buf, len);
|
||||
if (ret != len) {
|
||||
|
Reference in New Issue
Block a user