Unverified Commit 4aa2ecd9 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #4269 from jianqingdu/unstable

fix not call va_end() when syncWrite() failed
parents 4bffeda8 498f65ff
...@@ -1330,7 +1330,8 @@ char *sendSynchronousCommand(int flags, int fd, ...) { ...@@ -1330,7 +1330,8 @@ char *sendSynchronousCommand(int flags, int fd, ...) {
cmd = sdscat(cmd,arg); cmd = sdscat(cmd,arg);
} }
cmd = sdscatlen(cmd,"\r\n",2); cmd = sdscatlen(cmd,"\r\n",2);
va_end(ap);
/* Transfer command to the server. */ /* Transfer command to the server. */
if (syncWrite(fd,cmd,sdslen(cmd),server.repl_syncio_timeout*1000) if (syncWrite(fd,cmd,sdslen(cmd),server.repl_syncio_timeout*1000)
== -1) == -1)
...@@ -1340,7 +1341,6 @@ char *sendSynchronousCommand(int flags, int fd, ...) { ...@@ -1340,7 +1341,6 @@ char *sendSynchronousCommand(int flags, int fd, ...) {
strerror(errno)); strerror(errno));
} }
sdsfree(cmd); sdsfree(cmd);
va_end(ap);
} }
/* Read the reply from the server. */ /* Read the reply from the server. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment