]> git.saurik.com Git - redis.git/commitdiff
fixed two leaks for the dual encoded lists
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Sat, 5 Jun 2010 09:16:50 +0000 (11:16 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Sat, 5 Jun 2010 09:16:50 +0000 (11:16 +0200)
redis.c

diff --git a/redis.c b/redis.c
index d507adae19a7568814e9b206bc3c7ed8c5512fd0..d358ba3a148d62825f008592e9cc94a34402533c 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -4191,7 +4191,6 @@ static robj *rdbLoadObject(int type, FILE *fp) {
             } else {
                 ele = tryObjectEncoding(ele);
                 listAddNodeTail(o->ptr,ele);
-                incrRefCount(ele);
             }
         }
     } else if (type == REDIS_SET) {
@@ -5128,6 +5127,7 @@ static void listTypeConvert(robj *subject, int enc) {
 
     if (enc == REDIS_ENCODING_LIST) {
         list *l = listCreate();
+        listSetFreeMethod(l,decrRefCount);
 
         /* listTypeGet returns a robj with incremented refcount */
         li = listTypeInitIterator(subject,0,REDIS_TAIL);