CID 1251: If the NetStack::Init() fails, return the corresponding error instead

of setting the global net stack to a deleted value.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27479 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2008-09-13 14:41:42 +00:00
parent 2391ca5568
commit 84cd8e6902

View File

@ -88,8 +88,10 @@ NetStack::CreateDefault()
return B_NO_MEMORY;
status_t error = netStack->Init();
if (error != B_OK)
if (error != B_OK) {
delete netStack;
return error;
}
sNetStack = netStack;
return B_OK;