diff options
author | Rock Li <rock@appannie.com> | 2013-02-05 15:56:04 +0800 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-02-05 10:49:20 +0100 |
commit | 8c0b9f778e8dcd3df6320edb565bb94ce6cd614a (patch) | |
tree | 6b480bc891a94e12a10874def6983119707516de | |
parent | 63dc34bd014d147705473c29d5577ffc7e972a53 (diff) | |
download | redis-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.c | 2 |
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); |