Fix three simple clang analyzer warnings

This commit is contained in:
Matt Stancliff 2014-11-13 23:35:10 -05:00
parent 9b786b124d
commit d956d809ac
3 changed files with 3 additions and 3 deletions

View File

@ -720,7 +720,7 @@ int rdbSave(char *filename) {
char tmpfile[256];
FILE *fp;
rio rdb;
int error;
int error = 0;
snprintf(tmpfile,256,"temp-%d.rdb", (int) getpid());
fp = fopen(tmpfile,"w");

View File

@ -577,7 +577,7 @@ void sentinelEvent(int level, char *type, sentinelRedisInstance *ri,
if (level == REDIS_WARNING && ri != NULL) {
sentinelRedisInstance *master = (ri->flags & SRI_MASTER) ?
ri : ri->master;
if (master->notification_script) {
if (master && master->notification_script) {
sentinelScheduleScriptExecution(master->notification_script,
type,msg,NULL);
}

View File

@ -1382,7 +1382,7 @@ void zremrangeGenericCommand(redisClient *c, int rangetype) {
robj *key = c->argv[1];
robj *zobj;
int keyremoved = 0;
unsigned long deleted;
unsigned long deleted = 0;
zrangespec range;
zlexrangespec lexrange;
long start, end, llen;