* small correction in error handling code path

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21684 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2007-07-22 19:33:08 +00:00
parent 6f867cc1de
commit d069bd6917
1 changed files with 6 additions and 1 deletions

View File

@ -475,9 +475,14 @@ BRegion::_SetSize(long newSize)
fData = (clipping_rect*)realloc(fData, newSize * sizeof(clipping_rect));
else
fData = (clipping_rect*)malloc(newSize * sizeof(clipping_rect));
} else {
// just an empty region, but no error
MakeEmpty();
return true;
}
if (!fData || newSize <= 0) {
if (!fData) {
// allocation actually failed
fDataSize = 0;
MakeEmpty();
return false;