[CRIU] [PATCH 1/3] util: call va_end() after va_copy()

Andrey Vagin avagin at openvz.org
Fri Feb 5 11:03:28 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.

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..746596c 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(args);
 			if (ret >= delta) {
 				/* NOTE: vsnprintf returns the amount of bytes
 				 * to allocate. */
-- 
2.4.3



More information about the CRIU mailing list