another leak fixed. Can't find more for now, but still a bug in ZSETs to fix

This commit is contained in:
antirez 2009-10-26 17:33:31 +01:00
parent 599379ddda
commit ad807e6fa3

View File

@ -3731,17 +3731,21 @@ static zskiplist *zslCreate(void) {
static void zslFreeNode(zskiplistNode *node) {
decrRefCount(node->obj);
zfree(node->forward);
zfree(node);
}
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) {
next = node->forward[0];
zslFreeNode(node);
node = next;
}
zfree(zsl);
}
static int zslRandomLevel(void) {