From: Jaroslav Kysela Date: Fri, 3 Oct 2014 13:49:38 +0000 (+0200) Subject: htsbuf: add two missing va_end() calls to htsbuf_vqprintf() X-Git-Tag: v4.1~1189 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b991efe320d0a45ea1712c19a98a79107db33df;p=thirdparty%2Ftvheadend.git htsbuf: add two missing va_end() calls to htsbuf_vqprintf() --- diff --git a/src/htsbuf.c b/src/htsbuf.c index f1b9bbae6..c3b0a4c6f 100644 --- a/src/htsbuf.c +++ b/src/htsbuf.c @@ -254,8 +254,8 @@ htsbuf_vqprintf(htsbuf_queue_t *hq, const char *fmt, va_list ap0) char buf[100], *p, *np; va_copy(ap, ap0); - n = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); if(n > -1 && n < sizeof(buf)) { htsbuf_append(hq, buf, n); return; @@ -269,6 +269,7 @@ htsbuf_vqprintf(htsbuf_queue_t *hq, const char *fmt, va_list ap0) /* Try to print in the allocated space. */ va_copy(ap, ap0); n = vsnprintf(p, size, fmt, ap); + va_end(ap); if(n > -1 && n < size) { htsbuf_append_prealloc(hq, p, n); return;