Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions rcl_yaml_param_parser/src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,13 +998,14 @@ static rcutils_ret_t add_val_to_string_arr(
val_array->data[0U] = value;
} else {
/// Increase the array size by one and add the new value
val_array->data = allocator.reallocate(
char ** new_string_arr_ptr = allocator.reallocate(
val_array->data,
((val_array->size + 1U) * sizeof(char *)), allocator.state);
if (NULL == val_array->data) {
if (NULL == new_string_arr_ptr) {
RCUTILS_SAFE_FWRITE_TO_STDERR("Error allocating mem\n");
return RCUTILS_RET_BAD_ALLOC;
}
val_array->data = new_string_arr_ptr;
val_array->data[val_array->size] = value;
val_array->size++;
}
Expand Down