From: oharboe Date: Thu, 6 Mar 2008 17:13:33 +0000 (+0000) Subject: Pavel Chromy: va_copy should always be paired with va_end. X-Git-Tag: v0.1.0~830 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=d74d72c73a692fbdf222c4cb595a5d015f4611c9;hp=ff59d1c49516f9a858972ec354391fda5a444891 Pavel Chromy: va_copy should always be paired with va_end. git-svn-id: svn://svn.berlios.de/openocd/trunk@459 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- diff --git a/src/helper/log.c b/src/helper/log.c index 3d4f0389de..694e8a8b21 100644 --- a/src/helper/log.c +++ b/src/helper/log.c @@ -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;