summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-03-31 19:52:15 +0200
committerantirez <antirez@gmail.com>2011-03-31 19:54:08 +0200
commitfb90934c476ee0ece9b1dc0d9e05c766c96c0b3f (patch)
treed182b3c47d88af9c622896e4aeed7389baee6a88
parent207ca3cedd6eec8a38bdd4e73e0ca3db5e410b80 (diff)
downloadredis-fb90934c476ee0ece9b1dc0d9e05c766c96c0b3f.tar.gz
fixed memory leak introduced with the previous commit. Many thanks to Pieter Noordhuis for spotting it in no time
-rw-r--r--src/networking.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/networking.c b/src/networking.c
index dd26f7452..510ed82ac 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));