mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-07 03:40:27 +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: #3396 Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com> Acked-by: Gang Chen <gang.c.chen@intel.com>
This commit is contained in:
@@ -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