From 5b94b8ac5d10dded6bb79909c660fe8d3f3ba677 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 31 Mar 2011 19:52:15 +0200 Subject: [PATCH] fixed memory leak introduced with the previous commit. Many thanks to Pieter Noordhuis for spotting it in no time --- src/networking.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index 7f42a4cb..32c06306 100644 --- a/src/networking.c +++ b/src/networking.c @@ -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));