Commit cc90f79b authored by WuYunlong's avatar WuYunlong Committed by antirez
Browse files

Fix potential memory leak of rioWriteBulkStreamID().

parent ecd17e81
......@@ -1149,7 +1149,10 @@ int rioWriteBulkStreamID(rio *r,streamID *id) {
int retval;
sds replyid = sdscatfmt(sdsempty(),"%U-%U",id->ms,id->seq);
if ((retval = rioWriteBulkString(r,replyid,sdslen(replyid))) == 0) return 0;
if ((retval = rioWriteBulkString(r,replyid,sdslen(replyid))) == 0) {
sdsfree(replyid);
return 0;
}
sdsfree(replyid);
return retval;
}
......
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