Skip to content

Commit db9b09f

Browse files
authored
Merge pull request open-mpi#13365 from hppritcha/fix_cid_1646446
CID 1646446 fix memory leak
2 parents 0e19149 + a2c0279 commit db9b09f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ompi/mca/coll/tuned/coll_tuned_dynamic_file.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Copyright (c) 2024 NVIDIA CORPORATION. All rights reserved.
1616
* Copyright (c) 2025 Amazon.com, Inc. or its affiliates. All rights
1717
* reserved.
18+
* Copyright (c) 2025 Triad National Security, LLC. All rights
19+
* reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -261,6 +263,7 @@ static int ompi_coll_tuned_read_rules_json (const opal_json_t *json_root, ompi_c
261263
opal_output_verbose(1, ompi_coll_tuned_stream,
262264
"The \"collectives\" field must be a dictionary of collectives.");
263265
opal_json_free(&collectives_obj);
266+
free(alg_rules);
264267
return OPAL_ERROR;
265268
}
266269

@@ -363,6 +366,9 @@ static int ompi_coll_tuned_read_rules_json (const opal_json_t *json_root, ompi_c
363366
opal_json_free(&comm_rule);
364367
opal_json_free(&comm_rule_array);
365368
opal_json_free(&collectives_obj);
369+
if (NULL != alg_rules) {
370+
free(alg_rules);
371+
}
366372
return OMPI_ERROR;
367373
}
368374

@@ -719,4 +725,4 @@ int ompi_coll_tuned_read_rules_config_file (char *fname, ompi_coll_alg_rule_t**
719725
}
720726
return ret;
721727

722-
}
728+
}

0 commit comments

Comments
 (0)