Skip to content

Commit

Permalink
va_copy must be matched by va_end
Browse files Browse the repository at this point in the history
Hat tip to @rfuchs. See: redis/hiredis#178.

Fixes #1187
  • Loading branch information
pietern authored and antirez committed Aug 26, 2014
1 parent 748a36c commit 327831e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sds.c
Expand Up @@ -388,6 +388,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(ap);
if (buf[buflen-2] != '\0') {
if (buf != staticbuf) zfree(buf);
buflen *= 2;
Expand Down

0 comments on commit 327831e

Please sign in to comment.