diff --git a/server/modules/filter/cache/lrustorage.cc b/server/modules/filter/cache/lrustorage.cc index 2ded6e7f9..8d221f590 100644 --- a/server/modules/filter/cache/lrustorage.cc +++ b/server/modules/filter/cache/lrustorage.cc @@ -25,6 +25,14 @@ LRUStorage::LRUStorage(Storage* pstorage, size_t max_count, size_t max_size) LRUStorage::~LRUStorage() { + Node* pnode = phead_; + + while (phead_) + { + free_node(phead_); // Adjusts phead_ + } + + delete pstorage_; } cache_result_t LRUStorage::get_key(const char* zdefault_db, diff --git a/server/modules/filter/cache/storagereal.cc b/server/modules/filter/cache/storagereal.cc index 8858e20c6..c04325f29 100644 --- a/server/modules/filter/cache/storagereal.cc +++ b/server/modules/filter/cache/storagereal.cc @@ -25,6 +25,7 @@ StorageReal::StorageReal(CACHE_STORAGE_API* pApi, CACHE_STORAGE* pStorage) StorageReal::~StorageReal() { + m_pApi->freeInstance(m_pStorage); } cache_result_t StorageReal::get_info(uint32_t flags, json_t** ppInfo) const