mirror of
https://github.com/fluencelabs/redis
synced 2025-06-15 10:11:21 +00:00
Streams: fix memory leak in streamTrimByLength().
This commit is contained in:
@ -334,6 +334,7 @@ int64_t streamTrimByLength(stream *s, size_t maxlen, int approx) {
|
|||||||
/* Check if we can remove the whole node, and still have at
|
/* Check if we can remove the whole node, and still have at
|
||||||
* least maxlen elements. */
|
* least maxlen elements. */
|
||||||
if (s->length - entries >= maxlen) {
|
if (s->length - entries >= maxlen) {
|
||||||
|
lpFree(lp);
|
||||||
raxRemove(s->rax,ri.key,ri.key_len,NULL);
|
raxRemove(s->rax,ri.key,ri.key_len,NULL);
|
||||||
raxSeek(&ri,">=",ri.key,ri.key_len);
|
raxSeek(&ri,">=",ri.key,ri.key_len);
|
||||||
s->length -= entries;
|
s->length -= entries;
|
||||||
|
Reference in New Issue
Block a user