44 * Copyright (c) 2019 Intel, Inc. All rights reserved.
55 * Copyright (c) 2019 Research Organization for Information Science
66 * and Technology (RIST). All rights reserved.
7- * Copyright (c) 2021 Triad National Security, LLC. All rights
7+ * Copyright (c) 2021-2024 Triad National Security, LLC. All rights
88 * reserved.
99 * Copyright (c) 2022 Google, LLC. All rights reserved.
1010 * Copyright (c) 2022 IBM Corporation. All rights reserved.
@@ -107,6 +107,10 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
107107 // cleans up the MCA vars. This will cause the string to go
108108 // out of scope unless we place the pointer to it on the heap.
109109 opal_common_ucx .tls = (char * * ) malloc (sizeof (char * ));
110+ * opal_common_ucx .tls = NULL ;
111+ }
112+
113+ if (NULL == * opal_common_ucx .tls ) {
110114 * opal_common_ucx .tls = strdup (default_tls );
111115 }
112116
@@ -122,8 +126,13 @@ OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *
122126
123127 if (NULL == opal_common_ucx .devices ) {
124128 opal_common_ucx .devices = (char * * ) malloc (sizeof (char * ));
129+ * opal_common_ucx .devices = NULL ;
130+ }
131+
132+ if (NULL == * opal_common_ucx .devices ) {
125133 * opal_common_ucx .devices = strdup (default_devices );
126134 }
135+
127136 devices_index = mca_base_var_register (
128137 "opal" , "opal_common" , "ucx" , "devices" ,
129138 "List of device driver pattern names, which, if supported by UCX, will "
0 commit comments