Pavel Chromy: va_copy should always be paired with va_end.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 6 Mar 2008 17:13:33 +0000 (17:13 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 6 Mar 2008 17:13:33 +0000 (17:13 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@459 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/helper/log.c

index 3d4f0389de7a36f608c637e91e7f7d197b0cdbde..694e8a8b2126aa98b181f8bcd8e3c5d1051ebf47 100644 (file)
@@ -288,6 +288,9 @@ char *alloc_printf(const char *fmt, va_list ap)
 
                int ret;
                ret = vsnprintf(string, size, fmt, ap_copy);
+               
+               va_end(ap_copy);
+               
                /* NB! The result of the vsnprintf() might be an *EMPTY* string! */
                if ((ret >= 0) && ((ret + 1) < size))
                        break;