Skip to content

Commit 3acae58

Browse files
authored
Merge pull request #13306 from wjjahah/main
fix some memleak
2 parents 7478a0c + 21888a3 commit 3acae58

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

ompi/mca/op/avx/op_avx_component.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,6 @@ avx_component_op_query(struct ompi_op_t *op, int *priority)
298298
}
299299
}
300300
#endif
301-
if( NULL != module->opm_fns[i] ) {
302-
OBJ_RETAIN(module);
303-
}
304-
if( NULL != module->opm_3buff_fns[i] ) {
305-
OBJ_RETAIN(module);
306-
}
307301
}
308302
break;
309303
case OMPI_OP_BASE_FORTRAN_LAND:

opal/mca/common/ucx/common_ucx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
7373
{
7474
char *default_tls = "rc_verbs,ud_verbs,rc_mlx5,dc_mlx5,ud_mlx5,cuda_ipc,rocm_ipc";
7575
char *default_devices = "mlx*";
76+
char *old_str = NULL;
7677
int hook_index;
7778
int verbose_index;
7879
int progress_index;
@@ -113,6 +114,7 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
113114
if (NULL == *opal_common_ucx.tls) {
114115
*opal_common_ucx.tls = strdup(default_tls);
115116
}
117+
old_str = *opal_common_ucx.tls;
116118

117119
tls_index = mca_base_var_register(
118120
"opal", "opal_common", "ucx", "tls",
@@ -123,6 +125,7 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
123125
"please set to '^posix,sysv,self,tcp,cma,knem,xpmem'.",
124126
MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE | MCA_BASE_VAR_FLAG_DWG,
125127
OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_LOCAL, opal_common_ucx.tls);
128+
free(old_str);
126129

127130
if (NULL == opal_common_ucx.devices) {
128131
opal_common_ucx.devices = (char**) malloc(sizeof(char*));
@@ -132,13 +135,15 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
132135
if (NULL == *opal_common_ucx.devices) {
133136
*opal_common_ucx.devices = strdup(default_devices);
134137
}
138+
old_str = *opal_common_ucx.devices;
135139

136140
devices_index = mca_base_var_register(
137141
"opal", "opal_common", "ucx", "devices",
138142
"List of device driver pattern names, which, if supported by UCX, will "
139143
"bump its priority above ob1. Special values: any (any available)",
140144
MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE | MCA_BASE_VAR_FLAG_DWG,
141145
OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_LOCAL, opal_common_ucx.devices);
146+
free(old_str);
142147

143148
if (component) {
144149
mca_base_var_register_synonym(verbose_index, component->mca_project_name,
@@ -206,6 +211,9 @@ OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void)
206211
}
207212
opal_mem_hooks_unregister_release(opal_common_ucx_mem_release_cb);
208213
opal_output_close(opal_common_ucx.output);
214+
if (opal_common_ucx.opal_mem_hooks) {
215+
mca_base_framework_close(&opal_memory_base_framework);
216+
}
209217
}
210218

211219
#if HAVE_DECL_OPEN_MEMSTREAM

0 commit comments

Comments
 (0)