From 2b99d77a57ec16e56ebdf72a31500a026b450bc1 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 87e5aed0..ccae0f06 100644 --- a/src/replication.c +++ b/src/replication.c @@ -1330,7 +1330,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) @@ -1340,7 +1341,6 @@ char *sendSynchronousCommand(int flags, int fd, ...) { strerror(errno)); } sdsfree(cmd); - va_end(ap); } /* Read the reply from the server. */