VM{Kernel,User}Area::Create(): On error free the area's memory heeding the
given allocation flags. Could deadlock otherwise. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36571 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
40f1dd8443
commit
a5de454f45
@ -33,7 +33,8 @@ VMKernelArea::Create(VMAddressSpace* addressSpace, const char* name,
|
||||
return NULL;
|
||||
|
||||
if (area->Init(name, allocationFlags) != B_OK) {
|
||||
delete area;
|
||||
area->~VMKernelArea();
|
||||
free_etc(area, allocationFlags);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,8 @@ VMUserArea::Create(VMAddressSpace* addressSpace, const char* name,
|
||||
return NULL;
|
||||
|
||||
if (area->Init(name, allocationFlags) != B_OK) {
|
||||
delete area;
|
||||
area->~VMUserArea();
|
||||
free_etc(area, allocationFlags);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user