From 94cbd7cbfb64b1f7fc07cff353fda89e998801b8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 May 2024 11:24:13 +1000 Subject: [PATCH] AP_NavEKF3: use NEW_NOTHROW for new(std::nothrow) --- libraries/AP_NavEKF3/AP_NavEKF3_RngBcnFusion.cpp | 2 +- libraries/AP_NavEKF3/AP_NavEKF3_core.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_RngBcnFusion.cpp b/libraries/AP_NavEKF3/AP_NavEKF3_RngBcnFusion.cpp index 6fc98f0814..92a2ba4eec 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_RngBcnFusion.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3_RngBcnFusion.cpp @@ -43,7 +43,7 @@ void NavEKF3_core::BeaconFusion::InitialiseVariables() auto *beacon = AP::dal().beacon(); if (beacon != nullptr) { const uint8_t count = beacon->count(); - fusionReport = new BeaconFusion::FusionReport[count]; + fusionReport = NEW_NOTHROW BeaconFusion::FusionReport[count]; if (fusionReport != nullptr) { numFusionReports = count; } diff --git a/libraries/AP_NavEKF3/AP_NavEKF3_core.cpp b/libraries/AP_NavEKF3/AP_NavEKF3_core.cpp index af10084e6c..6c750ff63a 100644 --- a/libraries/AP_NavEKF3/AP_NavEKF3_core.cpp +++ b/libraries/AP_NavEKF3/AP_NavEKF3_core.cpp @@ -172,7 +172,7 @@ bool NavEKF3_core::setup_core(uint8_t _imu_index, uint8_t _core_index) } // try to instantiate - yawEstimator = new EKFGSF_yaw(); + yawEstimator = NEW_NOTHROW EKFGSF_yaw(); if (yawEstimator == nullptr) { GCS_SEND_TEXT(MAV_SEVERITY_CRITICAL, "EKF3 IMU%uGSF: allocation failed",(unsigned)imu_index); return false;