Skip to content

Commit

Permalink
Fix issues raised by clang analyzer
Browse files Browse the repository at this point in the history
Closes #1660
  • Loading branch information
kashif authored and mattsta committed Aug 2, 2014
1 parent 0ad4417 commit 534356d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/redis-cli.c
Expand Up @@ -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 */
}

Expand Down
5 changes: 3 additions & 2 deletions src/redis.c
Expand Up @@ -2559,20 +2559,21 @@ sds genRedisInfoString(char *section) {
int j, numcommands;
struct rusage self_ru, c_ru;
unsigned long lol, bib;
int allsections = 0, defsections = 0;
int allsections = 0, defsections = 0, serversections = 0;
int sections = 0;

if (section) {
allsections = strcasecmp(section,"all") == 0;
defsections = strcasecmp(section,"default") == 0;
serversections = strcasecmp(section,"server") == 0;
}

getrusage(RUSAGE_SELF, &self_ru);
getrusage(RUSAGE_CHILDREN, &c_ru);
getClientsMaxBuffers(&lol,&bib);

/* Server */
if (allsections || defsections || !strcasecmp(section,"server")) {
if (allsections || defsections || serversections) {
static int call_uname = 1;
static struct utsname name;
char *mode;
Expand Down

0 comments on commit 534356d

Please sign in to comment.