From 8c0b9f778e8dcd3df6320edb565bb94ce6cd614a Mon Sep 17 00:00:00 2001 From: Rock Li Date: Tue, 5 Feb 2013 15:56:04 +0800 Subject: [PATCH] retval doesn't initalized If each if conditions are all fail, variable retval will under uninitlized --- src/t_set.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/t_set.c b/src/t_set.c index 4db5372c..66e1f1f7 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -472,7 +472,7 @@ void srandmemberWithCountCommand(redisClient *c) { /* Add all the elements into the temporary dictionary. */ si = setTypeInitIterator(set); while((encoding = setTypeNext(si,&ele,&llele)) != -1) { - int retval; + int retval = DICT_ERR; if (encoding == REDIS_ENCODING_INTSET) { retval = dictAdd(d,createStringObjectFromLongLong(llele),NULL);