Commit cd76bb65 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Free the sds in addReplySds when it cannot be added to the reply

parent 2403fc9f
...@@ -128,7 +128,11 @@ void addReply(redisClient *c, robj *obj) { ...@@ -128,7 +128,11 @@ void addReply(redisClient *c, robj *obj) {
} }
void addReplySds(redisClient *c, sds s) { void addReplySds(redisClient *c, sds s) {
if (_ensureFileEvent(c) != REDIS_OK) return; if (_ensureFileEvent(c) != REDIS_OK) {
/* The caller expects the sds to be free'd. */
sdsfree(s);
return;
}
if (sdslen(s) < REDIS_REPLY_CHUNK_THRESHOLD) { if (sdslen(s) < REDIS_REPLY_CHUNK_THRESHOLD) {
_addReplyStringToBuffer(c,s,sdslen(s)); _addReplyStringToBuffer(c,s,sdslen(s));
sdsfree(s); sdsfree(s);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment