Skip to content

Commit 3fec7c1

Browse files
committed
SITL: Just exit(1) if insufficient memory for string duplication
1 parent f2d990a commit 3fec7c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/AP_HAL_SITL/SITL_State.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ void SITL_State::_parse_param_init_vals(const char *to_be_set, Param_Init_Values
4040

4141
char *for_parsing = strdup(to_be_set);
4242
if (for_parsing == nullptr) {
43-
AP_HAL::panic("strdup failed (insufficient memory)");
43+
printf("strdup failed (insufficient memory)");
44+
exit(1);
4445
}
4546

4647
char *saveptr = nullptr;

0 commit comments

Comments
 (0)