mirror of
https://github.com/fluencelabs/redis
synced 2025-07-18 01:51:56 +00:00
va_copy must be matched by va_end
Hat tip to @rfuchs. See: https://github.com/redis/hiredis/pull/178. Fixes #1187
This commit is contained in:
committed by
antirez
parent
748a36cf04
commit
327831e59e
@@ -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;
|
||||
|
Reference in New Issue
Block a user