* 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:
parent
6f867cc1de
commit
d069bd6917
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue