X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fhelper%2Flog.c;h=694e8a8b2126aa98b181f8bcd8e3c5d1051ebf47;hp=3d4f0389de7a36f608c637e91e7f7d197b0cdbde;hb=d74d72c73a692fbdf222c4cb595a5d015f4611c9;hpb=ff59d1c49516f9a858972ec354391fda5a444891 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;