diff --git a/src/replication.c b/src/replication.c index a9fe1d66a..8c01bfb51 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. */