Merge pull request #7204 from ShooterIT/benchmark-fix

Redis Benchmark: Fix coredump because of double free
This commit is contained in:
Salvatore Sanfilippo 2020-05-08 10:53:20 +02:00 committed by GitHub
commit 5fa6f9ebe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);