mirror of
https://github.com/fluencelabs/redis
synced 2025-03-31 14:51:04 +00:00
another leak fixed. Can't find more for now, but still a bug in ZSETs to fix
This commit is contained in:
parent
599379ddda
commit
ad807e6fa3
6
redis.c
6
redis.c
@ -3731,17 +3731,21 @@ static zskiplist *zslCreate(void) {
|
|||||||
|
|
||||||
static void zslFreeNode(zskiplistNode *node) {
|
static void zslFreeNode(zskiplistNode *node) {
|
||||||
decrRefCount(node->obj);
|
decrRefCount(node->obj);
|
||||||
|
zfree(node->forward);
|
||||||
zfree(node);
|
zfree(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void zslFree(zskiplist *zsl) {
|
static void zslFree(zskiplist *zsl) {
|
||||||
zskiplistNode *node = zsl->header->forward[1], *next;
|
zskiplistNode *node = zsl->header->forward[0], *next;
|
||||||
|
|
||||||
|
zfree(zsl->header->forward);
|
||||||
|
zfree(zsl->header);
|
||||||
while(node) {
|
while(node) {
|
||||||
next = node->forward[0];
|
next = node->forward[0];
|
||||||
zslFreeNode(node);
|
zslFreeNode(node);
|
||||||
node = next;
|
node = next;
|
||||||
}
|
}
|
||||||
|
zfree(zsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int zslRandomLevel(void) {
|
static int zslRandomLevel(void) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user