diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2020-01-13 13:23:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-13 13:23:49 +0100 |
commit | 9506c860f6642bc14aa4079e991c1c298138044a (patch) | |
tree | 730ddefc5b554273d1e07ceb7b40c5e9fa0d7925 /src/aof.c | |
parent | baa88a1c144954469e3762023fb41617242dc30e (diff) | |
parent | d6a13f444003e75e8ccbe97297bf32f0eb58cb23 (diff) | |
download | redis-9506c860f6642bc14aa4079e991c1c298138044a.tar.gz |
Merge pull request #6739 from trevor211/fixMemoryLeak
Fix potential memory leak of rioWriteBulkStreamID().
Diffstat (limited to 'src/aof.c')
-rw-r--r-- | src/aof.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |