diff --git a/src/redis-cli.c b/src/redis-cli.c index 89afbbcb..eafeb190 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -644,6 +644,7 @@ static int cliSendCommand(int argc, char **argv, int repeat) { printf("Entering slave output mode... (press Ctrl-C to quit)\n"); slaveMode(); config.slave_mode = 0; + free(argvlen); return REDIS_ERR; /* Error = slaveMode lost connection to master */ } diff --git a/src/redis.c b/src/redis.c index c5c3f79b..dff480c0 100644 --- a/src/redis.c +++ b/src/redis.c @@ -2562,10 +2562,9 @@ sds genRedisInfoString(char *section) { int allsections = 0, defsections = 0; int sections = 0; - if (section) { - allsections = strcasecmp(section,"all") == 0; - defsections = strcasecmp(section,"default") == 0; - } + if (section == NULL) section = "default"; + allsections = strcasecmp(section,"all") == 0; + defsections = strcasecmp(section,"default") == 0; getrusage(RUSAGE_SELF, &self_ru); getrusage(RUSAGE_CHILDREN, &c_ru);