From 682eb6a6cdfdc02e6594354dbd40222ab5d5df3e 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 9d4bab670..a522cd88a 100644 --- a/src/t_set.c +++ b/src/t_set.c @@ -491,7 +491,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);