When the password is wrong, redis-benchmark should exit (#8855)

(cherry picked from commit 8423b77f14c0d3a58e580c65a70b4f980f5cdcf6)
This commit is contained in:
Yang Bodong 2021-04-25 19:00:35 +08:00 committed by Oran Agra
parent 9158a510e1
commit ce288cb559

View File

@ -1782,8 +1782,10 @@ int main(int argc, const char **argv) {
} else { } else {
config.redis_config = config.redis_config =
getRedisConfig(config.hostip, config.hostport, config.hostsocket); getRedisConfig(config.hostip, config.hostport, config.hostsocket);
if (config.redis_config == NULL) if (config.redis_config == NULL) {
fprintf(stderr, "WARN: could not fetch server CONFIG\n"); fprintf(stderr, "WARN: could not fetch server CONFIG\n");
exit(1);
}
} }
if (config.num_threads > 0) { if (config.num_threads > 0) {
pthread_mutex_init(&(config.liveclients_mutex), NULL); pthread_mutex_init(&(config.liveclients_mutex), NULL);