Merge pull request #6820 from wckzhang/cleanup
btl tcp: Fix error path memory leak
Этот коммит содержится в:
Коммит
41c2007af5
@ -17,7 +17,7 @@
|
|||||||
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved
|
* Copyright (c) 2015-2018 Cisco Systems, Inc. All rights reserved
|
||||||
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
|
* Copyright (c) 2018-2019 Amazon.com, Inc. or its affiliates. All Rights reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
* Additional copyrights may follow
|
* Additional copyrights may follow
|
||||||
@ -198,8 +198,6 @@ mca_btl_tcp_proc_t* mca_btl_tcp_proc_create(opal_proc_t* proc)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(remote_addrs);
|
|
||||||
|
|
||||||
/* allocate space for endpoint array - one for each exported address */
|
/* allocate space for endpoint array - one for each exported address */
|
||||||
btl_proc->proc_endpoints = (mca_btl_base_endpoint_t**)
|
btl_proc->proc_endpoints = (mca_btl_base_endpoint_t**)
|
||||||
malloc((1 + btl_proc->proc_addr_count) *
|
malloc((1 + btl_proc->proc_addr_count) *
|
||||||
@ -223,6 +221,10 @@ cleanup:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (NULL != remote_addrs) {
|
||||||
|
free(remote_addrs);
|
||||||
|
}
|
||||||
|
|
||||||
OPAL_THREAD_UNLOCK(&mca_btl_tcp_component.tcp_lock);
|
OPAL_THREAD_UNLOCK(&mca_btl_tcp_component.tcp_lock);
|
||||||
|
|
||||||
return btl_proc;
|
return btl_proc;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user