diff --git a/libraries/AP_Avoidance/AP_Avoidance.cpp b/libraries/AP_Avoidance/AP_Avoidance.cpp index 14e0d28628..60dd149b47 100644 --- a/libraries/AP_Avoidance/AP_Avoidance.cpp +++ b/libraries/AP_Avoidance/AP_Avoidance.cpp @@ -144,7 +144,7 @@ void AP_Avoidance::init(void) { debug("ADSB initialisation: %d obstacles", _obstacles_max.get()); if (_obstacles == nullptr) { - _obstacles = new AP_Avoidance::Obstacle[_obstacles_max]; + _obstacles = NEW_NOTHROW AP_Avoidance::Obstacle[_obstacles_max]; if (_obstacles == nullptr) { // dynamic RAM allocation of _obstacles[] failed, disable gracefully