From 74f8ba2acb81aa6be573ad4832618cd089a8c2b8 Mon Sep 17 00:00:00 2001 From: mjbhaskar Date: Wed, 7 Jan 2015 14:34:38 -0600 Subject: [PATCH] A fix for memory corruption problem --- ompi/mca/io/ompio/io_ompio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ompi/mca/io/ompio/io_ompio.c b/ompi/mca/io/ompio/io_ompio.c index a6516eeddc..6258820f29 100644 --- a/ompi/mca/io/ompio/io_ompio.c +++ b/ompi/mca/io/ompio/io_ompio.c @@ -2228,7 +2228,7 @@ int mca_io_ompio_merge_initial_groups(mca_io_ompio_file_t *fh, } end = i; } - merge_aggrs = (int *)malloc((end - start) * sizeof(int)); + merge_aggrs = (int *)malloc((end - start + 1) * sizeof(int)); if (NULL == merge_aggrs) { opal_output (1, "OUT OF MEMORY\n"); return OMPI_ERR_OUT_OF_RESOURCE;