summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-05-09 11:13:32 +0200
committerantirez <antirez@gmail.com>2020-05-09 11:13:32 +0200
commit1750513ac762ef1d2d488e3c7d79a1002a905508 (patch)
treecc7b4fd767557656a50afa1f43812a002a1652e8
parent4387ba6a17887d23c1919619f517b521eacbb665 (diff)
parent5fa6f9ebe12c439b56c17ac49db1796516fe5319 (diff)
downloadredis-1750513ac762ef1d2d488e3c7d79a1002a905508.tar.gz
Merge branch 'unstable' of github.com:/antirez/redis into unstable
-rw-r--r--src/redis-benchmark.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-benchmark.c b/src/redis-benchmark.c
index 77daf981c..34295147d 100644
--- a/src/redis-benchmark.c
+++ b/src/redis-benchmark.c
@@ -279,7 +279,7 @@ static redisConfig *getRedisConfig(const char *ip, int port,
for (; i < 2; i++) {
int res = redisGetReply(c, &r);
if (reply) freeReplyObject(reply);
- reply = ((redisReply *) r);
+ reply = res == REDIS_OK ? ((redisReply *) r) : NULL;
if (res != REDIS_OK || !r) goto fail;
if (reply->type == REDIS_REPLY_ERROR) {
fprintf(stderr, "ERROR: %s\n", reply->str);