[CRIU] [PATCH] util: call va_end() after va_copy() (v2)

Andrey Vagin avagin at openvz.org
Fri Feb 5 15:02:17 PST 2016


From: Andrew Vagin <avagin at virtuozzo.com>

CID 157804 (#1 of 1): Missing varargs init or cleanup (VARARGS)
16. missing_va_end: va_end was not called for tmp.

v2: typo fix

Reported-by: Mr Coverity
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 util.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util.c b/util.c
index 241670c..7a61cc5 100644
--- a/util.c
+++ b/util.c
@@ -75,6 +75,7 @@ static char *xvstrcat(char *str, const char *fmt, va_list args)
 		if (new) {
 			va_copy(tmp, args);
 			ret = vsnprintf(new + offset, delta, fmt, tmp);
+			va_end(tmp);
 			if (ret >= delta) {
 				/* NOTE: vsnprintf returns the amount of bytes
 				 * to allocate. */
-- 
2.4.3



More information about the CRIU mailing list