Unverified Commit bb671d90 authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Add missing zuiClearIterator in zrandmemberWithCountCommand. (#8979)

Also the bug that currently does not cause memory leaks.
Because op->type = OBJ_ZSET, in zuiClearIterator, we will do nothing.
Just a cleanup that zuiInitIterator and zuiClearIterator should appear in pairs.
parent 156599ba
......@@ -4070,6 +4070,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
if (withscores)
addReplyDouble(c, zval.score);
}
zuiClearIterator(&src);
return;
}
......@@ -4137,6 +4138,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
zarndmemberReplyWithZiplist(c, count, keys, vals);
zfree(keys);
zfree(vals);
zuiClearIterator(&src);
return;
}
......@@ -4170,6 +4172,7 @@ void zrandmemberWithCountCommand(client *c, long l, int withscores) {
/* Release memory */
dictRelease(d);
}
zuiClearIterator(&src);
}
/* ZRANDMEMBER [<count> WITHSCORES] */
......
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