diff --git a/ompi/mca/fcoll/static/fcoll_static_file_read_all.c b/ompi/mca/fcoll/static/fcoll_static_file_read_all.c index fb6c8ede44..2cb7769861 100644 --- a/ompi/mca/fcoll/static/fcoll_static_file_read_all.c +++ b/ompi/mca/fcoll/static/fcoll_static_file_read_all.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights reserved. + * * $COPYRIGHT$ * * Additional copyrights may follow @@ -1008,6 +1010,17 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh, free(receive_buf); receive_buf=NULL; } + + if (NULL != global_buf) { + free(global_buf); + global_buf = NULL; + } + + if (NULL != sorted) { + free(sorted); + sorted = NULL; + } + return ret; } diff --git a/ompi/mca/fcoll/static/fcoll_static_file_write_all.c b/ompi/mca/fcoll/static/fcoll_static_file_write_all.c index d03708d6fd..f1cb7cd988 100644 --- a/ompi/mca/fcoll/static/fcoll_static_file_write_all.c +++ b/ompi/mca/fcoll/static/fcoll_static_file_write_all.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. + * Copyright (c) 2015 Los Alamos National Security, LLC. All rights reserved. + * * $COPYRIGHT$ * * Additional copyrights may follow @@ -627,7 +629,8 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, temp_disp_index = (int *)calloc (1, fh->f_procs_per_group * sizeof (int)); if (NULL == temp_disp_index) { opal_output (1, "OUT OF MEMORY\n"); - return OMPI_ERR_OUT_OF_RESOURCE; + ret = OMPI_ERR_OUT_OF_RESOURCE; + goto exit; } global_count = 0; for (i=0;i