From e1803597575d5bb70558df688c9416469eed2bca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 May 2024 11:24:13 +1000 Subject: [PATCH] AP_Menu: use NEW_NOTHROW for new(std::nothrow) --- libraries/AP_Menu/AP_Menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_Menu/AP_Menu.cpp b/libraries/AP_Menu/AP_Menu.cpp index 647b4eea60..5ce3dac825 100644 --- a/libraries/AP_Menu/AP_Menu.cpp +++ b/libraries/AP_Menu/AP_Menu.cpp @@ -261,11 +261,11 @@ Menu::_allocate_buffers(void) { /* only allocate if the buffers are nullptr */ if (_inbuf == nullptr) { - _inbuf = new char[_commandline_max]; + _inbuf = NEW_NOTHROW char[_commandline_max]; memset(_inbuf, 0, _commandline_max); } if (_argv == nullptr) { - _argv = new arg[_args_max+1]; + _argv = NEW_NOTHROW arg[_args_max+1]; memset(_argv, 0, (_args_max+1) * sizeof(_argv[0])); } }