diff --git a/runtime/vm/handles_impl.h b/runtime/vm/handles_impl.h index 7cfb01c329618..e5b731cc19243 100644 --- a/runtime/vm/handles_impl.h +++ b/runtime/vm/handles_impl.h @@ -156,7 +156,11 @@ void Handles:: CountScopedHandles()); } if (scoped_blocks_->next_block() == NULL) { - scoped_blocks_->set_next_block(new HandlesBlock(NULL)); + HandlesBlock* block = new HandlesBlock(NULL); + if (block == NULL) { + OUT_OF_MEMORY(); + } + scoped_blocks_->set_next_block(block); } scoped_blocks_ = scoped_blocks_->next_block(); scoped_blocks_->set_next_handle_slot(0); @@ -203,7 +207,9 @@ void Handles:: CountScopedHandles()); } zone_blocks_ = new HandlesBlock(zone_blocks_); - ASSERT(zone_blocks_ != NULL); + if (zone_blocks_ == NULL) { + OUT_OF_MEMORY(); + } } #if defined(DEBUG)