summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRock Li <rock@appannie.com>2013-02-05 15:56:04 +0800
committerantirez <antirez@gmail.com>2013-02-05 10:49:20 +0100
commit8c0b9f778e8dcd3df6320edb565bb94ce6cd614a (patch)
tree6b480bc891a94e12a10874def6983119707516de
parent63dc34bd014d147705473c29d5577ffc7e972a53 (diff)
downloadredis-8c0b9f778e8dcd3df6320edb565bb94ce6cd614a.tar.gz
retval doesn't initalized
If each if conditions are all fail, variable retval will under uninitlized
-rw-r--r--src/t_set.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_set.c b/src/t_set.c
index 4db5372cd..66e1f1f70 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);