projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2403fc9
)
Free the sds in addReplySds when it cannot be added to the reply
author
Pieter Noordhuis
<pcnoordhuis@gmail.com>
Thu, 2 Sep 2010 12:19:15 +0000
(14:19 +0200)
committer
Pieter Noordhuis
<pcnoordhuis@gmail.com>
Thu, 2 Sep 2010 17:52:04 +0000
(19:52 +0200)
src/networking.c
patch
|
blob
|
blame
|
history
diff --git
a/src/networking.c
b/src/networking.c
index d2a4e231570f3c313a276e59d773b933af039af1..89613cedf5c8183c23caec05f5023e5e5bd57f48 100644
(file)
--- a/
src/networking.c
+++ b/
src/networking.c
@@
-128,7
+128,11
@@
void addReply(redisClient *c, robj *obj) {
}
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) {
_addReplyStringToBuffer(c,s,sdslen(s));
sdsfree(s);