From 6bd2be548bce7b1791d64f78a7d4a9b2a82975c6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 May 2024 11:24:14 +1000 Subject: [PATCH] AP_Param: use NEW_NOTHROW for new(std::nothrow) --- libraries/AP_Param/AP_Param.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Param/AP_Param.cpp b/libraries/AP_Param/AP_Param.cpp index b44f4d2c02..65915b4d88 100644 --- a/libraries/AP_Param/AP_Param.cpp +++ b/libraries/AP_Param/AP_Param.cpp @@ -2391,7 +2391,7 @@ bool AP_Param::load_defaults_file(const char *filename, bool last_pass) num_param_overrides = 0; num_read_only = 0; - param_overrides = new param_override[num_defaults]; + param_overrides = NEW_NOTHROW param_override[num_defaults]; if (param_overrides == nullptr) { AP_HAL::panic("AP_Param: Failed to allocate overrides"); return false; @@ -2486,7 +2486,7 @@ void AP_Param::load_param_defaults(const volatile char *ptr, int32_t length, boo return; } - param_overrides = new param_override[num_defaults]; + param_overrides = NEW_NOTHROW param_override[num_defaults]; if (param_overrides == nullptr) { AP_HAL::panic("AP_Param: Failed to allocate overrides"); return; @@ -2882,7 +2882,7 @@ void AP_Param::add_default(AP_Param *ap, float v) } // add to list - defaults_list *new_item = new defaults_list; + defaults_list *new_item = NEW_NOTHROW defaults_list; if (new_item == nullptr) { return; }