fixed memory leak introduced with the previous commit. Many thanks to Pieter Noordhuis for spotting it in no time

This commit is contained in:
antirez 2011-03-31 19:52:15 +02:00
parent baffa73b48
commit 3b666e64dc

View 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));