va_copy must be followed by va_end

This commit is contained in:
Richard Fuchs 2013-07-02 12:41:13 -04:00
parent bcf8354376
commit b15650e13a
1 changed files with 1 additions and 0 deletions

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;