summaryrefslogtreecommitdiffstats
path: root/src/H5FDfamily.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDfamily.c')
-rw-r--r--src/H5FDfamily.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 9817270..87e5e84 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -818,9 +818,11 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
/* Enlarge member array */
if(file->nmembs >= file->amembs) {
unsigned n = MAX(64, 2 * file->amembs);
- H5FD_t **x = (H5FD_t **)H5MM_realloc(file->memb, n * sizeof(H5FD_t *));
+ H5FD_t **x;
- if(!x)
+ HDassert(n > 0);
+ /* coverity["freed_arg"] */
+ if(NULL == (x = (H5FD_t **)H5MM_realloc(file->memb, n * sizeof(H5FD_t *))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to reallocate members")
file->amembs = n;
file->memb = x;