From 0db5a1569683385fbe6c5268f4d6754b72e25487 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 13 Feb 2020 09:15:32 +0900 Subject: [PATCH] ompi/dpm: plug misc memory leaks Signed-off-by: Gilles Gouaillardet --- ompi/dpm/dpm.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ompi/dpm/dpm.c b/ompi/dpm/dpm.c index efd13069f3..a336769839 100644 --- a/ompi/dpm/dpm.c +++ b/ompi/dpm/dpm.c @@ -16,7 +16,8 @@ * Copyright (c) 2011-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2013-2019 Intel, Inc. All rights reserved. - * Copyright (c) 2014-2017 Research Organization for Information Science + * Copyright (c) 2013-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2014-2020 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved. * $COPYRIGHT$ @@ -1126,7 +1127,7 @@ int ompi_dpm_dyn_finalize(void) ompi_communicator_t *comm=NULL; if (1 reqs) { + free(objs[i]->reqs); + } + free(objs[i]); + } free(objs); return OMPI_ERROR; } - disconnect_waitall(ompi_comm_num_dyncomm, objs); + disconnect_waitall(ompi_comm_num_dyncomm+1, objs); free(objs); } @@ -1173,6 +1181,7 @@ static ompi_dpm_disconnect_obj *disconnect_init(ompi_communicator_t *comm) int i; obj = (ompi_dpm_disconnect_obj*)calloc(1,sizeof(ompi_dpm_disconnect_obj)); + // printf("obj = %p\n", obj); if (NULL == obj) { opal_output(0, "Could not allocate disconnect object"); return NULL; @@ -1269,6 +1278,7 @@ static int disconnect_waitall (int count, ompi_dpm_disconnect_obj **objs) if (NULL != objs[i]->reqs ) { free(objs[i]->reqs ); } + // printf("%d/%d free %p\n", i, count, objs[i]); free(objs[i]); }