Fix CID 879. We leaked some stuff in case of error. Removed useless check.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38247 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
65341d518f
commit
1c9ed76e33
@ -103,14 +103,20 @@ BMailChain::Load(BMessage* settings)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!filter_settings.AddItem(filter) || !filter_addons.AddItem(ref))
|
||||
break;
|
||||
if (!filter_settings.AddItem(filter)) {
|
||||
delete filter;
|
||||
delete ref;
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
|
||||
if (!filter_addons.AddItem(ref)) {
|
||||
filter_settings.RemoveItem(filter);
|
||||
delete filter;
|
||||
delete ref;
|
||||
return B_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
if (filter_settings.CountItems() != settings_ct
|
||||
|| filter_addons.CountItems() != addons_ct)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user