aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenstore/cache/cachedisklayer.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c477d6f13..b157af66c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@
- Bugfix: If zenserver fails to pick up a request for a sponsor process, make sure to clear the slot
- Bugfix: Fix potential hole where an chunk could be lost during GC if the package referenced a chunk that already existed in store
- Bugfix: Make op key and file path matching in `zen oplog-mirror` case insensitive
+- Bugfix: Fixed memory leak in cache (would leak GetBatchHandle instances)
## 5.5.9
- Feature: Added command `zen cache-get` to fetch a cache value/record or an attachment from a cache record
diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp
index 8c93d8a3a..4aafb9828 100644
--- a/src/zenstore/cache/cachedisklayer.cpp
+++ b/src/zenstore/cache/cachedisklayer.cpp
@@ -1313,6 +1313,8 @@ struct ZenCacheDiskLayer::CacheBucket::GetBatchHandle
ResultIndexes.reserve(OutResults.capacity());
}
+ ~GetBatchHandle() {}
+
std::vector<IoHash> Keys;
std::vector<size_t> ResultIndexes;
@@ -1625,6 +1627,8 @@ ZenCacheDiskLayer::CacheBucket::EndGetBatch(GetBatchHandle* Batch) noexcept
}
}
}
+
+ delete Batch;
}
catch (const std::exception& Ex)
{