From: antirez Date: Thu, 3 Jun 2010 16:22:15 +0000 (+0200) Subject: memory leak introduced in the latest big changes fixed X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/4c8f23700b2943ff724d4ea5c7830d939dbd08d2?ds=sidebyside memory leak introduced in the latest big changes fixed --- diff --git a/redis.c b/redis.c index 35b9ba25..e67ba20d 100644 --- a/redis.c +++ b/redis.c @@ -9403,7 +9403,9 @@ static int vmSwapOneObject(int usethreads) { /* Swap it */ if (usethreads) { - vmSwapObjectThreaded(createStringObject(key,sdslen(key)),val,best_db); + robj *keyobj = createStringObject(key,sdslen(key)); + vmSwapObjectThreaded(keyobj,val,best_db); + decrRefCount(keyobj); return REDIS_OK; } else { vmpointer *vp;