From 66a8285b2e4ca08e59929bffdfa4156f15f790d8 Mon Sep 17 00:00:00 2001 From: Shane Loretz Date: Tue, 5 Jun 2018 10:21:07 -0700 Subject: [PATCH] deallocate parameter files in fini --- rcl/src/rcl/arguments.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rcl/src/rcl/arguments.c b/rcl/src/rcl/arguments.c index 7d55f493a4..f16994d173 100644 --- a/rcl/src/rcl/arguments.c +++ b/rcl/src/rcl/arguments.c @@ -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;