summaryrefslogtreecommitdiffstats
path: root/src/H5mpi.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-10-31 13:05:52 (GMT)
committerGitHub <noreply@github.com>2023-10-31 13:05:52 (GMT)
commit39c0284c38395aac9eb43364b14931fc2826b7f6 (patch)
tree9bf866cffaa6c8804a4153778320603b9aa1cc03 /src/H5mpi.c
parentebc1651425e6052824bae82b2a8016f9a8af4ff2 (diff)
downloadhdf5-39c0284c38395aac9eb43364b14931fc2826b7f6.zip
hdf5-39c0284c38395aac9eb43364b14931fc2826b7f6.tar.gz
hdf5-39c0284c38395aac9eb43364b14931fc2826b7f6.tar.bz2
Fix a couple usages of MPI_Info_get (#3809)
Diffstat (limited to 'src/H5mpi.c')
-rw-r--r--src/H5mpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5mpi.c b/src/H5mpi.c
index 2725ec5..cf7e33d 100644
--- a/src/H5mpi.c
+++ b/src/H5mpi.c
@@ -380,9 +380,9 @@ H5_mpi_info_cmp(MPI_Info info1, MPI_Info info2, int *result)
/* Allocate buffers for iteration */
if (NULL == (key = (char *)H5MM_malloc(MPI_MAX_INFO_KEY * sizeof(char))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
- if (NULL == (value1 = (char *)H5MM_malloc(MPI_MAX_INFO_VAL * sizeof(char))))
+ if (NULL == (value1 = (char *)H5MM_malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
- if (NULL == (value2 = (char *)H5MM_malloc(MPI_MAX_INFO_VAL * sizeof(char))))
+ if (NULL == (value2 = (char *)H5MM_malloc((MPI_MAX_INFO_VAL + 1) * sizeof(char))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
/* Iterate over the keys, comparing them */