mirror of https://github.com/ArduPilot/ardupilot
AC_Avoidance: check for alloc failure of ObjectBuffer
This commit is contained in:
parent
57ee3a4e02
commit
e184e78e52
|
@ -187,6 +187,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()
|
||||
|
|
Loading…
Reference in New Issue