summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/aof.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/aof.c b/src/aof.c
index 0ef59cfb6..102c39f3f 100644
--- a/src/aof.c
+++ b/src/aof.c
@@ -1139,7 +1139,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;
}