summaryrefslogtreecommitdiff
path: root/src/defrag.c
diff options
context:
space:
mode:
authorWen Hui <wen.hui.ware@gmail.com>2020-07-21 01:13:05 -0400
committerGitHub <noreply@github.com>2020-07-21 08:13:05 +0300
commit4e8f2d6881a38397bfbf0d7d161959163a5f6e88 (patch)
tree0763d8c1727c4b93a032460c4848fbd1c6742d20 /src/defrag.c
parent2fbd0271f6fc0a93b9323b6478ec1a7a4ca77614 (diff)
downloadredis-4e8f2d6881a38397bfbf0d7d161959163a5f6e88.tar.gz
Add missing calls to raxStop (#7532)
Since the dynamic allocations in raxIterator are only used for deep walks, memory leak due to missing call to raxStop can only happen for rax with key names longer than 32 bytes. Out of all the missing calls, the only ones that may lead to a leak are the rax for consumer groups and consumers, and these were only in AOFRW and rdbSave, which normally only happen in fork or at shutdown.
Diffstat (limited to 'src/defrag.c')
-rw-r--r--src/defrag.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/defrag.c b/src/defrag.c
index 2d8db8ea5..07a16ca6c 100644
--- a/src/defrag.c
+++ b/src/defrag.c
@@ -662,6 +662,7 @@ int scanLaterStraemListpacks(robj *ob, unsigned long *cursor, long long endtime,
/* if cursor is non-zero, we seek to the static 'last' */
if (!raxSeek(&ri,">", last, sizeof(last))) {
*cursor = 0;
+ raxStop(&ri);
return 0;
}
/* assign the iterator node callback after the seek, so that the