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])); } }