mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-09 16:41:21 +08:00
AP_Scripting: Delete the lua object if we failed to allocate the required memory
This commit is contained in:
1 parent
6753e99604
commit
d50e9865bd
1 file changed
+1
@@ -157,6 +157,7 @@ void AP_Scripting::thread(void) {
|
||||
lua_scripts *lua = new lua_scripts(_script_vm_exec_count, _script_heap_size, _debug_level, terminal);
|
||||
if (lua == nullptr || !lua->heap_allocated()) {
|
||||
gcs().send_text(MAV_SEVERITY_CRITICAL, "Unable to allocate scripting memory");
|
||||
delete lua;
|
||||
_init_failed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user