From 51388bd012248fa30d0d18209ad02d5a2ffb63a5 Mon Sep 17 00:00:00 2001 From: Patrick Winnertz Date: Tue, 3 Feb 2009 20:09:40 +0100 Subject: [PATCH] Call va_end after the iteration as we need to free the list again. Signed-off-by: Patrick Winnertz --- mhl/string.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mhl/string.h b/mhl/string.h index da8658406..fcbbd864f 100644 --- a/mhl/string.h +++ b/mhl/string.h @@ -71,7 +71,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...) va_start(args,base); char* a; /* note: we use ((char*)(1)) as terminator - NULL is a valid argument ! */ - while ((a = va_arg(args, char*))!=(char*)1 && count <= 31 ) + while ((a = va_arg(args, char*))!=(char*)1 && count < __STR_CONCAT_MAX ) { if (a) { @@ -81,6 +81,7 @@ static inline char* __mhl_str_concat_hlp(const char* base, ...) count++; } } + va_end(args); if (!count) return mhl_str_dup("");