diff options
author | jianqingdu <jianqing.du@live.cn> | 2017-08-30 21:20:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-30 21:20:14 -0500 |
commit | 498f65ffb77e7fab9c9085394657ba7b46bedde9 (patch) | |
tree | 63f1f064ac7a3ded4054458c36d173cab48eaa91 | |
parent | 202c2ebec4d47d6f8cfbb6c91dd4486dd62aebf6 (diff) | |
download | redis-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.c | 4 |
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. */ |