]> git.saurik.com Git - redis.git/commitdiff
another leak fixed. Can't find more for now, but still a bug in ZSETs to fix
authorantirez <antirez@gmail.com>
Mon, 26 Oct 2009 16:33:31 +0000 (17:33 +0100)
committerantirez <antirez@gmail.com>
Mon, 26 Oct 2009 16:33:31 +0000 (17:33 +0100)
redis.c

diff --git a/redis.c b/redis.c
index c45beecff1d2c24e943f7ab85ecc6f27321d1b00..ffa416972bdd9b860c3b736b2bc4fe14e7f05247 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -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) {