Merge pull request #4269 from jianqingdu/unstable

fix not call va_end() when syncWrite() failed
This commit is contained in:
Salvatore Sanfilippo 2018-01-24 10:55:25 +01:00 committed by GitHub
commit 4aa2ecd98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1330,6 +1330,7 @@ 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)
@ -1340,7 +1341,6 @@ char *sendSynchronousCommand(int flags, int fd, ...) {
strerror(errno));
}
sdsfree(cmd);
va_end(ap);
}
/* Read the reply from the server. */