mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Fix memory leak in RM_StreamIteratorStop and moduleFreeKeyIterator (#10353)
* Fix memory leak in RM_StreamIteratorStop * Fix memory leak in moduleFreeKeyIterator
This commit is contained in:
parent
9478d5a134
commit
dff153ff24
@ -596,7 +596,10 @@ static void moduleFreeKeyIterator(RedisModuleKey *key) {
|
||||
serverAssert(key->iter != NULL);
|
||||
switch (key->value->type) {
|
||||
case OBJ_LIST: listTypeReleaseIterator(key->iter); break;
|
||||
case OBJ_STREAM: zfree(key->iter); break;
|
||||
case OBJ_STREAM:
|
||||
streamIteratorStop(key->iter);
|
||||
zfree(key->iter);
|
||||
break;
|
||||
default: serverAssert(0); /* No key->iter for other types. */
|
||||
}
|
||||
key->iter = NULL;
|
||||
@ -5103,6 +5106,7 @@ int RM_StreamIteratorStop(RedisModuleKey *key) {
|
||||
errno = EBADF;
|
||||
return REDISMODULE_ERR;
|
||||
}
|
||||
streamIteratorStop(key->iter);
|
||||
zfree(key->iter);
|
||||
key->iter = NULL;
|
||||
return REDISMODULE_OK;
|
||||
|
Loading…
Reference in New Issue
Block a user