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:
Ingo Weinhold 2010-05-01 18:50:21 +00:00
parent 40f1dd8443
commit a5de454f45
2 changed files with 4 additions and 2 deletions

View File

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

View File

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