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
074e28a4
Unverified
Commit
074e28a4
authored
Apr 26, 2021
by
sundb
Committed by
GitHub
Apr 26, 2021
Browse files
Simplify rax free for RM_FreeServerInfo (#8866)
parent
a8b6596d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
074e28a4
...
...
@@ -7101,16 +7101,7 @@ RedisModuleServerInfoData *RM_GetServerInfo(RedisModuleCtx *ctx, const char *sec
* context instead of passing NULL. */
void
RM_FreeServerInfo
(
RedisModuleCtx
*
ctx
,
RedisModuleServerInfoData
*
data
)
{
if
(
ctx
!=
NULL
)
autoMemoryFreed
(
ctx
,
REDISMODULE_AM_INFO
,
data
);
raxIterator
ri
;
raxStart
(
&
ri
,
data
->
rax
);
while
(
1
)
{
raxSeek
(
&
ri
,
"^"
,
NULL
,
0
);
if
(
!
raxNext
(
&
ri
))
break
;
raxRemove
(
data
->
rax
,(
unsigned
char
*
)
ri
.
key
,
ri
.
key_len
,
NULL
);
sdsfree
(
ri
.
data
);
}
raxStop
(
&
ri
);
raxFree
(
data
->
rax
);
raxFreeWithCallback
(
data
->
rax
,
(
void
(
*
)(
void
*
))
sdsfree
);
zfree
(
data
);
}
...
...
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