From d72e7e9b2db886c63d6fecd1d50462b56e537fc4 Mon Sep 17 00:00:00 2001 From: degomme Date: Sat, 30 Apr 2016 13:14:56 +0200 Subject: [PATCH 1/1] leaks -- --- src/smpi/smpi_mpi_dt.cpp | 2 ++ src/smpi/smpi_pmpi.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/smpi/smpi_mpi_dt.cpp b/src/smpi/smpi_mpi_dt.cpp index c443eddf59..6e6410f279 100644 --- a/src/smpi/smpi_mpi_dt.cpp +++ b/src/smpi/smpi_mpi_dt.cpp @@ -201,6 +201,7 @@ int smpi_datatype_dup(MPI_Datatype datatype, MPI_Datatype* new_t) if(ret!=MPI_SUCCESS){ smpi_datatype_unuse(*new_t); *new_t=MPI_DATATYPE_NULL; + xbt_dict_cursor_free(&cursor); return ret; } if(flag) @@ -410,6 +411,7 @@ void smpi_datatype_free(MPI_Datatype* type){ if(elem && elem->delete_fn) elem->delete_fn(*type,*key, value, &flag); } + xbt_dict_free(&(*type)->attributes); } if ((*type)->sizeof_substruct != 0){ diff --git a/src/smpi/smpi_pmpi.cpp b/src/smpi/smpi_pmpi.cpp index 22637d7489..729c51a3fd 100644 --- a/src/smpi/smpi_pmpi.cpp +++ b/src/smpi/smpi_pmpi.cpp @@ -3219,7 +3219,8 @@ int PMPI_Info_get_nthkey( MPI_Info info, int n, char *key){ int num=0; xbt_dict_foreach(info->info_dict,cursor,keyn,data){ if(num==n){ - strcpy(key,keyn); + strcpy(key,keyn); + xbt_dict_cursor_free(&cursor); return MPI_SUCCESS; } num++; -- 2.20.1