]> git.saurik.com Git - redis.git/commitdiff
fixed memory leak introduced with the previous commit. Many thanks to Pieter Noordhui...
authorantirez <antirez@gmail.com>
Thu, 31 Mar 2011 17:52:15 +0000 (19:52 +0200)
committerantirez <antirez@gmail.com>
Thu, 31 Mar 2011 17:52:15 +0000 (19:52 +0200)
src/networking.c

index 7f42a4cb3826d7f986a281d2f35be7c69344207b..32c063060c10b0d9037eeda8dd64a452cedf55ba 100644 (file)
@@ -135,7 +135,10 @@ void _addReplyObjectToList(redisClient *c, robj *o) {
 void _addReplySdsToList(redisClient *c, sds s) {
     robj *tail;
 
-    if (c->flags & REDIS_CLOSE_AFTER_REPLY) return;
+    if (c->flags & REDIS_CLOSE_AFTER_REPLY) {
+        sdsfree(s);
+        return;
+    }
 
     if (listLength(c->reply) == 0) {
         listAddNodeTail(c->reply,createObject(REDIS_STRING,s));