AC_Avoidance: check for alloc failure of ObjectBuffer

This commit is contained in:
Andrew Tridgell 2023-01-02 08:33:22 +11:00 committed by Randy Mackay
parent bbee8312dd
commit a99dd1fabf
1 changed files with 5 additions and 0 deletions

View File

@ -186,6 +186,11 @@ void AP_OADatabase::init_queue()
}
_queue.items = new ObjectBuffer<OA_DbItem>(_queue.size);
if (_queue.items != nullptr && _queue.items->get_size() == 0) {
// allocation failed
delete _queue.items;
_queue.items = nullptr;
}
}
void AP_OADatabase::init_database()