From 498f65ffb77e7fab9c9085394657ba7b46bedde9 Mon Sep 17 00:00:00 2001 From: jianqingdu Date: Wed, 30 Aug 2017 21:20:14 -0500 Subject: [PATCH] fix not call va_end when syncWrite() failed fix not call va_end when syncWrite() failed in sendSynchronousCommand() --- src/replication.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/replication.c b/src/replication.c index 6be5d263..b31f0da9 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1329,7 +1329,8 @@ char *sendSynchronousCommand(int flags, int fd, ...) { cmd = sdscat(cmd,arg); } cmd = sdscatlen(cmd,"\r\n",2); - + va_end(ap); + /* Transfer command to the server. */ if (syncWrite(fd,cmd,sdslen(cmd),server.repl_syncio_timeout*1000) == -1) @@ -1339,7 +1340,6 @@ char *sendSynchronousCommand(int flags, int fd, ...) { strerror(errno)); } sdsfree(cmd); - va_end(ap); } /* Read the reply from the server. */