From 0b991efe320d0a45ea1712c19a98a79107db33df Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 3 Oct 2014 15:49:38 +0200 Subject: [PATCH] htsbuf: add two missing va_end() calls to htsbuf_vqprintf() --- src/htsbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/htsbuf.c b/src/htsbuf.c index f1b9bbae..c3b0a4c6 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;