mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
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.
This commit is contained in:
parent
156599ba2d
commit
bb671d9016
@ -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] */
|
||||
|
Loading…
Reference in New Issue
Block a user