summaryrefslogtreecommitdiff
path: root/src/t_set.c
diff options
context:
space:
mode:
authorRock Li <rock@appannie.com>2013-02-05 15:56:04 +0800
committerRock Li <rock@appannie.com>2013-02-05 15:56:04 +0800
commit8063155cd0d0b5b3b0e7d30e9a12e52db7224c0f (patch)
tree44f37c100841c7cc935f917847b2d201fce07717 /src/t_set.c
parentf95b393603acb9a19ceb1814bded19c417e07c9d (diff)
downloadredis-8063155cd0d0b5b3b0e7d30e9a12e52db7224c0f.tar.gz
retval doesn't initalized
If each if conditions are all fail, variable retval will under uninitlized
Diffstat (limited to 'src/t_set.c')
-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 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);