From 7e5da7382e907f4fb099e62d1f1bcf4ad4c47156 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 10 Nov 2016 09:38:20 +0900 Subject: [PATCH] btl/tcp: plug leaks when closing component remove tcp_local from the tcp_procs table, and release it Signed-off-by: Gilles Gouaillardet --- opal/mca/btl/tcp/btl_tcp_component.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opal/mca/btl/tcp/btl_tcp_component.c b/opal/mca/btl/tcp/btl_tcp_component.c index f3567dbe3c..a979a0f8e7 100644 --- a/opal/mca/btl/tcp/btl_tcp_component.c +++ b/opal/mca/btl/tcp/btl_tcp_component.c @@ -17,7 +17,7 @@ * reserved. * Copyright (c) 2013-2015 NVIDIA Corporation. All rights reserved. * Copyright (c) 2014-2015 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -443,6 +443,11 @@ static int mca_btl_tcp_component_close(void) OBJ_RELEASE(event); } + if (NULL != mca_btl_tcp_component.tcp_local) { + opal_proc_table_remove_value(&mca_btl_tcp_component.tcp_procs, opal_proc_local_get()->proc_name); + OBJ_RELEASE(mca_btl_tcp_component.tcp_local); + } + /* release resources */ OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_procs); OBJ_DESTRUCT(&mca_btl_tcp_component.tcp_frag_eager);