Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a4e6aae6
Commit
a4e6aae6
authored
Sep 29, 2017
by
antirez
Browse files
Streams: fix memory leak in streamTrimByLength().
parent
e53c9030
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
a4e6aae6
...
...
@@ -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
* least maxlen elements. */
if
(
s
->
length
-
entries
>=
maxlen
)
{
lpFree
(
lp
);
raxRemove
(
s
->
rax
,
ri
.
key
,
ri
.
key_len
,
NULL
);
raxSeek
(
&
ri
,
">="
,
ri
.
key
,
ri
.
key_len
);
s
->
length
-=
entries
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment