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:
parent
37cd311852
commit
5b1ae51c6b
@ -88,8 +88,10 @@ public:
|
|||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
status_t result = fMap.Put(key, node);
|
status_t result = fMap.Put(key, node);
|
||||||
if (result != B_OK)
|
if (result != B_OK) {
|
||||||
|
delete node;
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
_SetNewestNode(node);
|
_SetNewestNode(node);
|
||||||
_PurgeExcess();
|
_PurgeExcess();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user