From 0e75d9d769df41a2277e4865f6ce68cb83a92ab5 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Tue, 1 Apr 2025 10:25:17 -0600 Subject: [PATCH] HAN: plug some memory leaks found by valgrind Related to #13171 Signed-off-by: Howard Pritchard --- ompi/mca/coll/han/coll_han_component.c | 1 + ompi/mca/coll/han/coll_han_subcomms.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ompi/mca/coll/han/coll_han_component.c b/ompi/mca/coll/han/coll_han_component.c index 4712bccbe88..a8a649dd080 100644 --- a/ompi/mca/coll/han/coll_han_component.c +++ b/ompi/mca/coll/han/coll_han_component.c @@ -147,6 +147,7 @@ static int han_open(void) static int han_close(void) { mca_coll_han_free_dynamic_rules(); + mca_coll_han_free_algorithms(); free(mca_coll_han_component.han_op_module_name.bcast.han_op_up_module_name); mca_coll_han_component.han_op_module_name.bcast.han_op_up_module_name = NULL; diff --git a/ompi/mca/coll/han/coll_han_subcomms.c b/ompi/mca/coll/han/coll_han_subcomms.c index d3327df9906..57344074a55 100644 --- a/ompi/mca/coll/han/coll_han_subcomms.c +++ b/ompi/mca/coll/han/coll_han_subcomms.c @@ -187,6 +187,9 @@ int mca_coll_han_comm_create_new(struct ompi_communicator_t *comm, /* * Set the cached info */ + if (NULL != han_module->cached_vranks) { + free(han_module->cached_vranks); + } han_module->cached_vranks = vranks; /* Restore the saved collectives */