Don't leak the object when allocating a magazine failed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35605 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
2882dba2a1
commit
462dd94a1f
@ -290,8 +290,10 @@ object_depot_store(object_depot* depot, void* object, uint32 flags)
|
||||
readLocker.Unlock();
|
||||
|
||||
DepotMagazine* magazine = alloc_magazine(depot, flags);
|
||||
if (magazine == NULL)
|
||||
if (magazine == NULL) {
|
||||
depot->return_object(depot, depot->cookie, object, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
readLocker.Lock();
|
||||
interruptsLocker.Lock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user