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:
@@ -33,7 +33,8 @@ VMKernelArea::Create(VMAddressSpace* addressSpace, const char* name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (area->Init(name, allocationFlags) != B_OK) {
|
if (area->Init(name, allocationFlags) != B_OK) {
|
||||||
delete area;
|
area->~VMKernelArea();
|
||||||
|
free_etc(area, allocationFlags);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ VMUserArea::Create(VMAddressSpace* addressSpace, const char* name,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (area->Init(name, allocationFlags) != B_OK) {
|
if (area->Init(name, allocationFlags) != B_OK) {
|
||||||
delete area;
|
area->~VMUserArea();
|
||||||
|
free_etc(area, allocationFlags);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user