diff --git a/headers/private/shared/LRUCache.h b/headers/private/shared/LRUCache.h index 57f35afcfa..3df0d9f897 100644 --- a/headers/private/shared/LRUCache.h +++ b/headers/private/shared/LRUCache.h @@ -88,8 +88,10 @@ public: if (node == NULL) return B_NO_MEMORY; status_t result = fMap.Put(key, node); - if (result != B_OK) + if (result != B_OK) { + delete node; return result; + } _SetNewestNode(node); _PurgeExcess(); }