mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 14:38:30 -04:00
AP_Scripting: check for alloc failure of ObjectBuffer
This commit is contained in:
parent
9154db9ae2
commit
68352534be
@ -274,6 +274,10 @@ void AP_Scripting::handle_mission_command(const AP_Mission::Mission_Command& cmd
|
||||
if (mission_data == nullptr) {
|
||||
// load buffer
|
||||
mission_data = new ObjectBuffer<struct AP_Scripting::scripting_mission_cmd>(mission_cmd_queue_size);
|
||||
if (mission_data != nullptr && mission_data->get_size() == 0) {
|
||||
delete mission_data;
|
||||
mission_data = nullptr;
|
||||
}
|
||||
if (mission_data == nullptr) {
|
||||
gcs().send_text(MAV_SEVERITY_INFO, "Scripting: %s", "unable to receive mission command");
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user