HaikuDepot: Memory Leak Fix

Change-Id: Ibd311d10009484ba834843149740c5a11f283202
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3500
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
This commit is contained in:
Andrew Lindesay 2020-12-13 21:17:08 +13:00 committed by Stephan Aßmus
parent 37cd311852
commit 5b1ae51c6b

View File

@ -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();
}