]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsbuf: add two missing va_end() calls to htsbuf_vqprintf()
authorJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 13:49:38 +0000 (15:49 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 3 Oct 2014 13:49:38 +0000 (15:49 +0200)
src/htsbuf.c

index f1b9bbae6f3942aac7389750516c380ed5a8e854..c3b0a4c6f26b139b5b2a40ce47a1f637df7c48e0 100644 (file)
@@ -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;