diff options
Diffstat (limited to 'src/H5HFsection.c')
-rw-r--r-- | src/H5HFsection.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5HFsection.c b/src/H5HFsection.c index e031ed2..62af976 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -3909,9 +3909,12 @@ HDfprintf(stderr, "%s: nrows_moved2 = %u\n", FUNC, nrows_moved2); /* Check if we need to move additional rows */ if(nrows_moved2 > 0) { + H5HF_free_section_t **new_dir_rows; /* Pointer to new array of direct row pointers */ + /* Extend the first section's row array */ - if(NULL == (sect1->u.indirect.dir_rows = H5MM_realloc(sect1->u.indirect.dir_rows, sizeof(H5HF_free_section_t *) * new_dir_nrows1))) + if(NULL == (new_dir_rows = H5MM_realloc(sect1->u.indirect.dir_rows, sizeof(H5HF_free_section_t *) * new_dir_nrows1))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for row section pointer array") + sect1->u.indirect.dir_rows = new_dir_rows; /* Transfer the second section's rows to first section */ HDmemcpy(§1->u.indirect.dir_rows[sect1->u.indirect.dir_nrows], @@ -3952,9 +3955,12 @@ HDfprintf(stderr, "%s: nrows_moved2 = %u\n", FUNC, nrows_moved2); sect2->u.indirect.indir_ents = NULL; } /* end if */ else { + H5HF_free_section_t **new_indir_ents; /* Pointer to new array of indirect entries */ + /* Extend the first section's entry array */ - if(NULL == (sect1->u.indirect.indir_ents = H5MM_realloc(sect1->u.indirect.indir_ents, sizeof(H5HF_free_section_t *) * new_indir_nents1))) + if(NULL == (new_indir_ents = H5MM_realloc(sect1->u.indirect.indir_ents, sizeof(H5HF_free_section_t *) * new_indir_nents1))) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "allocation failed for row section pointer array") + sect1->u.indirect.indir_ents = new_indir_ents; /* Transfer the second section's entries to first section */ HDmemcpy(§1->u.indirect.indir_ents[sect1->u.indirect.indir_nents], |