Skip to content

Commit

Permalink
deallocate parameter files in fini
Browse files Browse the repository at this point in the history
  • Loading branch information
sloretz committed Jun 5, 2018
1 parent 92b4025 commit 66a8285
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rcl/src/rcl/arguments.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,16 @@ rcl_arguments_fini(
args->impl->num_unparsed_args = 0;
args->impl->unparsed_args = NULL;

if (args->impl->parameter_files) {
for (int p = 0; p < args->impl->num_param_files_args; ++p) {
args->impl->allocator.deallocate(
args->impl->parameter_files[p], args->impl->allocator.state);
}
args->impl->allocator.deallocate(args->impl->parameter_files, args->impl->allocator.state);
args->impl->num_param_files_args = 0;
args->impl->parameter_files = NULL;
}

args->impl->allocator.deallocate(args->impl, args->impl->allocator.state);
args->impl = NULL;
return ret;
Expand Down

0 comments on commit 66a8285

Please sign in to comment.