From 512232772707c623cc7e72174f2941b35b924216 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Fri, 2 Oct 2015 21:38:31 -0600 Subject: [PATCH] fcoll/two_phase: fix new coverity errors Fix CID 1325467: use after free Remove extra free of aggregator_list. Fix CID 1325466: resource leak Fix typo in prior coverity fix. Signed-off-by: Nathan Hjelm --- ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c | 2 +- ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c index 63247a65eb5..0c29c98de75 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c @@ -500,7 +500,7 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, if (flat_buf->indices != NULL){ free (flat_buf->indices); } - flat_buf = NULL; + free (flat_buf); } free (start_offsets); diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c index aaa7eb4289d..ac42ec1ecf5 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c @@ -274,7 +274,6 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, total_bytes = (size_t) long_total_bytes; if ( 0 == total_bytes ) { - free(aggregator_list); ret = OMPI_SUCCESS; goto exit; }