summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjianqingdu <jianqing.du@live.cn>2017-08-30 21:20:14 -0500
committerGitHub <noreply@github.com>2017-08-30 21:20:14 -0500
commit498f65ffb77e7fab9c9085394657ba7b46bedde9 (patch)
tree63f1f064ac7a3ded4054458c36d173cab48eaa91
parent202c2ebec4d47d6f8cfbb6c91dd4486dd62aebf6 (diff)
downloadredis-498f65ffb77e7fab9c9085394657ba7b46bedde9.tar.gz
fix not call va_end when syncWrite() failed
fix not call va_end when syncWrite() failed in sendSynchronousCommand()
-rw-r--r--src/replication.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/replication.c b/src/replication.c
index 6be5d2631..b31f0da9f 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. */