Commit 8c0b9f77 authored by Rock Li's avatar Rock Li Committed by antirez
Browse files

retval doesn't initalized

If each if conditions are all fail, variable retval will under uninitlized
parent 63dc34bd
...@@ -472,7 +472,7 @@ void srandmemberWithCountCommand(redisClient *c) { ...@@ -472,7 +472,7 @@ void srandmemberWithCountCommand(redisClient *c) {
/* Add all the elements into the temporary dictionary. */ /* Add all the elements into the temporary dictionary. */
si = setTypeInitIterator(set); si = setTypeInitIterator(set);
while((encoding = setTypeNext(si,&ele,&llele)) != -1) { while((encoding = setTypeNext(si,&ele,&llele)) != -1) {
int retval; int retval = DICT_ERR;
if (encoding == REDIS_ENCODING_INTSET) { if (encoding == REDIS_ENCODING_INTSET) {
retval = dictAdd(d,createStringObjectFromLongLong(llele),NULL); retval = dictAdd(d,createStringObjectFromLongLong(llele),NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment