]> git.saurik.com Git - redis.git/commitdiff
Memory leak fixed: release client's bpop->keys dictionary.
authorantirez <antirez@gmail.com>
Mon, 3 Dec 2012 11:12:53 +0000 (12:12 +0100)
committerantirez <antirez@gmail.com>
Mon, 3 Dec 2012 11:17:56 +0000 (12:17 +0100)
Refactoring performed after issue #801 resolution (see commit
2f87cf8b0162bd9d78c3a89860c0971cd71d39db) introduced a memory leak that
is fixed by this commit.

I simply forgot to free the new allocated dictionary in the client
structure trusting the output of "make test" on OSX.

However due to changes in the "leaks" utility the test was no longer
testing memory leaks. This problem was also fixed.

Fortunately the CI test running at ci.redis.io spotted the bug in the
valgrind run.

The leak never ended into a stable release.

src/networking.c

index a352ba7621c18286142abff7a054e0d814524670..4365bc8ef0f88a44c44c29f1d619ebe4f1325110 100644 (file)
@@ -605,6 +605,7 @@ void freeClient(redisClient *c) {
     c->querybuf = NULL;
     if (c->flags & REDIS_BLOCKED)
         unblockClientWaitingData(c);
+    dictRelease(c->bpop.keys);
 
     /* UNWATCH all the keys */
     unwatchAllKeys(c);