danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Fix storagedb memory leak #352

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

Never wrap non-debug code within asserts to test the return value, the code will be discarded in the release builds leading to bugs.

In this case the storage db wasn't caching the storage db entry index objects for later reuse leading to a MASSIVE memory leak.

The PR fixes it, splitting the assert, and also adds a check to avoid trying to free already freed entry indexes.