From: Zdenek Kabelac Date: Tue, 23 Nov 2010 15:00:52 +0000 (+0000) Subject: Move va_end(ap) so we do not leave with return -1 without calling it. X-Git-Tag: v2_02_78~54 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=79a9cb910a98e2c93c5df85fae6d03ed17019b08;p=lvm2.git Move va_end(ap) so we do not leave with return -1 without calling it. Remove unneeded ';' --- diff --git a/libdm/libdm-string.c b/libdm/libdm-string.c index d8fca1a90..365e7ec0d 100644 --- a/libdm/libdm-string.c +++ b/libdm/libdm-string.c @@ -144,6 +144,8 @@ int dm_asprintf(char **result, const char *format, ...) while (!ok) { va_start(ap, format); n = vsnprintf(buf, size, format, ap); + va_end(ap); + if (0 <= n && n < size) ok = 1; else { @@ -152,8 +154,7 @@ int dm_asprintf(char **result, const char *format, ...) buf = dm_malloc(size); if (!buf) return -1; - }; - va_end(ap); + } } *result = dm_strdup(buf);