mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +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:
parent
3426866e0a
commit
cf85b5ba81
@ -388,6 +388,7 @@ sds sdscatvprintf(sds s, const char *fmt, va_list ap) {
|
|||||||
buf[buflen-2] = '\0';
|
buf[buflen-2] = '\0';
|
||||||
va_copy(cpy,ap);
|
va_copy(cpy,ap);
|
||||||
vsnprintf(buf, buflen, fmt, cpy);
|
vsnprintf(buf, buflen, fmt, cpy);
|
||||||
|
va_end(ap);
|
||||||
if (buf[buflen-2] != '\0') {
|
if (buf[buflen-2] != '\0') {
|
||||||
if (buf != staticbuf) zfree(buf);
|
if (buf != staticbuf) zfree(buf);
|
||||||
buflen *= 2;
|
buflen *= 2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user