From bad7d097e95ec0735c41f85b50ace65bec6134ae Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 26 Aug 2010 13:18:24 +0200 Subject: [PATCH] fixed a memory leak in the new Set code --- src/rdb.c | 2 ++ tests/test_helper.tcl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rdb.c b/src/rdb.c index 019aa9a0..12221b9f 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -714,6 +714,8 @@ robj *rdbLoadObject(int type, FILE *fp) { * to regular hashtable encoded set */ if (o->encoding == REDIS_ENCODING_HT) { dictAdd((dict*)o->ptr,ele,NULL); + } else { + decrRefCount(ele); } } } else if (type == REDIS_ZSET) { diff --git a/tests/test_helper.tcl b/tests/test_helper.tcl index 4ae9cc65..d4a0aa14 100644 --- a/tests/test_helper.tcl +++ b/tests/test_helper.tcl @@ -11,7 +11,7 @@ source tests/support/util.tcl set ::host 127.0.0.1 set ::port 16379 -set ::traceleaks 0 +set ::traceleaks 1 set ::valgrind 0 set ::denytags {} set ::allowtags {}