Merge pull request #178 from rfuchs/master

va_copy must be followed by va_end
This commit is contained in:
Pieter Noordhuis 2013-07-10 21:12:10 -07:00
commit 17d73ef6ad

1
sds.c
View File

@ -178,6 +178,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
buf[buflen-2] = '\0';
va_copy(cpy,ap);
vsnprintf(buf, buflen, fmt, cpy);
va_end(cpy);
if (buf[buflen-2] != '\0') {
free(buf);
buflen *= 2;