diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-01-05 04:24:01 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-01-05 04:24:01 (GMT) |
commit | b5ae4e56edfda4e5a7a0b8d7ad2e7f2c894a850a (patch) | |
tree | 2a8196083d828a0b4e8de794913e290aff466f66 /src | |
parent | 1b00123b2a0a2d77f1c19a473fce465cfa2bba9a (diff) | |
download | hdf5-b5ae4e56edfda4e5a7a0b8d7ad2e7f2c894a850a.zip hdf5-b5ae4e56edfda4e5a7a0b8d7ad2e7f2c894a850a.tar.gz hdf5-b5ae4e56edfda4e5a7a0b8d7ad2e7f2c894a850a.tar.bz2 |
[svn-r28803] Description:
Bring r28797, r28798, r28800, and r28802 from trunk to revise_chunks branch:
Misc. memory allocation cleanups
Tested on:
MacOSX/64 10.11.2 (amazon) w/serial & parallel
(h5committest not required on this branch)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B2.c | 9 | ||||
-rw-r--r-- | src/H5B2hdr.c | 15 | ||||
-rw-r--r-- | src/H5B2int.c | 35 | ||||
-rw-r--r-- | src/H5Dchunk.c | 4 | ||||
-rw-r--r-- | src/H5Dmpio.c | 30 | ||||
-rw-r--r-- | src/H5Dvirtual.c | 10 | ||||
-rw-r--r-- | src/H5FDlog.c | 14 | ||||
-rw-r--r-- | src/H5Ocopy.c | 4 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 4 |
9 files changed, 59 insertions, 66 deletions
@@ -42,6 +42,7 @@ #include "H5private.h" /* Generic Functions */ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /****************/ @@ -641,7 +642,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, if(idx == 0) { if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->min_native_rec == NULL) - if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info") HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -649,7 +650,7 @@ H5B2_find(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_found_t op, if(idx == (unsigned)(leaf->nrec - 1)) { if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->max_native_rec == NULL) - if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info") HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -1315,7 +1316,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, if(idx == 0) { if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->min_native_rec == NULL) - if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info") HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -1323,7 +1324,7 @@ H5B2_modify(H5B2_t *bt2, hid_t dxpl_id, void *udata, H5B2_modify_t op, if(idx == (unsigned)(leaf->nrec - 1)) { if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->max_native_rec == NULL) - if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info") HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ diff --git a/src/H5B2hdr.c b/src/H5B2hdr.c index 414d3c3..0676f30 100644 --- a/src/H5B2hdr.c +++ b/src/H5B2hdr.c @@ -38,7 +38,8 @@ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -630,14 +631,10 @@ H5B2__hdr_free(H5B2_hdr_t *hdr) } /* end if */ /* Release the min & max record info, if set */ - if(hdr->min_native_rec) { - HDfree(hdr->min_native_rec); - hdr->min_native_rec = NULL; - } /* end if */ - if(hdr->max_native_rec) { - HDfree(hdr->max_native_rec); - hdr->max_native_rec = NULL; - } /* end if */ + if(hdr->min_native_rec) + hdr->min_native_rec = H5MM_xfree(hdr->min_native_rec); + if(hdr->max_native_rec) + hdr->max_native_rec = H5MM_xfree(hdr->max_native_rec); /* Free B-tree header info */ hdr = H5FL_FREE(H5B2_hdr_t, hdr); diff --git a/src/H5B2int.c b/src/H5B2int.c index 972b91c..e66d430 100644 --- a/src/H5B2int.c +++ b/src/H5B2int.c @@ -38,7 +38,8 @@ #include "H5B2pkg.h" /* v2 B-trees */ #include "H5Eprivate.h" /* Error handling */ #include "H5MFprivate.h" /* File memory management */ -#include "H5VMprivate.h" /* Vectors and arrays */ +#include "H5MMprivate.h" /* Memory management */ +#include "H5VMprivate.h" /* Vectors and arrays */ /****************/ /* Local Macros */ @@ -2387,7 +2388,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr if(idx == 0) { if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->min_native_rec == NULL) - if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info") HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -2395,7 +2396,7 @@ H5B2__insert_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr if(idx == (unsigned)(leaf->nrec - 1)) { if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->max_native_rec == NULL) - if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info") HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -2688,7 +2689,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr if(idx == 0) { if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->min_native_rec == NULL) - if(NULL == (hdr->min_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->min_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree min record info") HDmemcpy(hdr->min_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -2696,7 +2697,7 @@ H5B2__update_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr if(idx == (unsigned)(leaf->nrec - 1)) { if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) { if(hdr->max_native_rec == NULL) - if(NULL == (hdr->max_native_rec = (uint8_t *)HDmalloc(hdr->cls->nrec_size))) + if(NULL == (hdr->max_native_rec = (uint8_t *)H5MM_malloc(hdr->cls->nrec_size))) HGOTO_ERROR(H5E_BTREE, H5E_CANTALLOC, FAIL, "memory allocation failed for v2 B-tree max record info") HDmemcpy(hdr->max_native_rec, H5B2_LEAF_NREC(leaf, hdr, idx), hdr->cls->nrec_size); } /* end if */ @@ -3348,18 +3349,14 @@ H5B2__remove_leaf(H5B2_hdr_t *hdr, hid_t dxpl_id, H5B2_node_ptr_t *curr_node_ptr /* (Don't use 'else' for the idx check, to allow for root leaf node) */ if(idx == 0) { if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) { - if(hdr->min_native_rec) { - HDfree(hdr->min_native_rec); - hdr->min_native_rec = NULL; - } /* end if */ + if(hdr->min_native_rec) + hdr->min_native_rec = H5MM_xfree(hdr->min_native_rec); } /* end if */ } /* end if */ if(idx == (unsigned)(leaf->nrec - 1)) { if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) { - if(hdr->max_native_rec) { - HDfree(hdr->max_native_rec); - hdr->max_native_rec = NULL; - } /* end if */ + if(hdr->max_native_rec) + hdr->max_native_rec = H5MM_xfree(hdr->max_native_rec); } /* end if */ } /* end if */ } /* end if */ @@ -3745,18 +3742,14 @@ H5B2__remove_leaf_by_idx(H5B2_hdr_t *hdr, hid_t dxpl_id, /* (Don't use 'else' for the idx check, to allow for root leaf node) */ if(idx == 0) { if(H5B2_POS_LEFT == curr_pos || H5B2_POS_ROOT == curr_pos) { - if(hdr->min_native_rec) { - HDfree(hdr->min_native_rec); - hdr->min_native_rec = NULL; - } /* end if */ + if(hdr->min_native_rec) + hdr->min_native_rec = H5MM_xfree(hdr->min_native_rec); } /* end if */ } /* end if */ if(idx == (unsigned)(leaf->nrec - 1)) { if(H5B2_POS_RIGHT == curr_pos || H5B2_POS_ROOT == curr_pos) { - if(hdr->max_native_rec) { - HDfree(hdr->max_native_rec); - hdr->max_native_rec = NULL; - } /* end if */ + if(hdr->max_native_rec) + hdr->max_native_rec = H5MM_xfree(hdr->max_native_rec); } /* end if */ } /* end if */ } /* end if */ diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 23c744c..a3ef0e5 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -4011,7 +4011,7 @@ H5D__chunk_allocate(const H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, write collectively at the end */ /* allocate/resize address array if no more space left */ if(0 == chunk_info.num_io % 1024) - if(NULL == (chunk_info.addr = (haddr_t *)HDrealloc(chunk_info.addr, (chunk_info.num_io + 1024) * sizeof(haddr_t)))) + if(NULL == (chunk_info.addr = (haddr_t *)H5MM_realloc(chunk_info.addr, (chunk_info.num_io + 1024) * sizeof(haddr_t)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed for chunk addresses") /* Store the chunk's address for later */ @@ -4104,7 +4104,7 @@ done: #ifdef H5_HAVE_PARALLEL if(using_mpi && chunk_info.addr) - HDfree(chunk_info.addr); + H5MM_free(chunk_info.addr); #endif FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index a5f34d1..0ba340a 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1680,7 +1680,6 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, MPI_Comm comm; int ic, root; int mpi_code; - hbool_t mem_cleanup = FALSE; #ifdef H5_HAVE_INSTRUMENTED_LIBRARY int new_value; htri_t check_prop; @@ -1715,12 +1714,14 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, threshold_nproc_per_chunk = mpi_size * percent_nproc_per_chunk/100; /* Allocate memory */ - io_mode_info = (uint8_t *)H5MM_calloc(total_chunks); - mergebuf = H5MM_malloc((sizeof(haddr_t) + 1) * total_chunks); + if(NULL == (io_mode_info = (uint8_t *)H5MM_calloc(total_chunks))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate I/O mode info buffer") + if(NULL == (mergebuf = H5MM_malloc((sizeof(haddr_t) + 1) * total_chunks))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate mergebuf buffer") tempbuf = mergebuf + total_chunks; if(mpi_rank == root) - recv_io_mode_info = (uint8_t *)H5MM_malloc(total_chunks * mpi_size); - mem_cleanup = TRUE; + if(NULL == (recv_io_mode_info = (uint8_t *)H5MM_malloc(total_chunks * mpi_size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate recv I/O mode info buffer") /* Obtain the regularity and selection information for all chunks in this process. */ chunk_node = H5SL_first(fm->sel_chunks); @@ -1742,11 +1743,12 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, /* pre-computing: calculate number of processes and regularity of the selection occupied in each chunk */ - nproc_per_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)); + if(NULL == (nproc_per_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate nproc_per_chunk buffer") /* calculating the chunk address */ if(H5D__chunk_addrmap(io_info, chunk_addr) < 0) { - HDfree(nproc_per_chunk); + H5MM_free(nproc_per_chunk); HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") } /* end if */ @@ -1774,7 +1776,7 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, HDmemcpy(mergebuf, assign_io_mode, total_chunks); HDmemcpy(tempbuf, chunk_addr, sizeof(haddr_t) * total_chunks); - HDfree(nproc_per_chunk); + H5MM_free(nproc_per_chunk); } /* end if */ /* Broadcasting the MPI_IO option info. and chunk address info. */ @@ -1824,11 +1826,13 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, #endif done: - if(mem_cleanup) { - HDfree(io_mode_info); - HDfree(mergebuf); - if(mpi_rank == root) - HDfree(recv_io_mode_info); + if(io_mode_info) + H5MM_free(io_mode_info); + if(mergebuf) + H5MM_free(mergebuf); + if(recv_io_mode_info) { + HDassert(mpi_rank == root); + H5MM_free(recv_io_mode_info); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 93fc61c..bcafde2 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -449,10 +449,10 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) /* Copy original source names */ if(NULL == (layout->storage.u.virt.list[i].source_file_name - = HDstrdup(orig_list[i].source_file_name))) + = H5MM_strdup(orig_list[i].source_file_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source file name") if(NULL == (layout->storage.u.virt.list[i].source_dset_name - = HDstrdup(orig_list[i].source_dset_name))) + = H5MM_strdup(orig_list[i].source_dset_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source dataset name") /* Copy source selection */ @@ -491,7 +491,7 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) } /* end if */ else if(NULL == (layout->storage.u.virt.list[i].source_dset.file_name - = HDstrdup(orig_list[i].source_dset.file_name))) + = H5MM_strdup(orig_list[i].source_dset.file_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source file name") } /* end if */ if(orig_list[i].source_dset.dset_name) { @@ -507,7 +507,7 @@ H5D__virtual_copy_layout(H5O_layout_t *layout) } /* end if */ else if(NULL == (layout->storage.u.virt.list[i].source_dset.dset_name - = HDstrdup(orig_list[i].source_dset.dset_name))) + = H5MM_strdup(orig_list[i].source_dset.dset_name))) HGOTO_ERROR(H5E_DATASET, H5E_RESOURCE, FAIL, "unable to duplicate source dataset name") } /* end if */ @@ -1127,7 +1127,7 @@ H5D__virtual_copy_parsed_name(H5O_storage_virtual_name_seg_t **dst, /* Duplicate name segment */ if(p_src->name_segment) { - if(NULL == ((*p_dst)->name_segment = HDstrdup(p_src->name_segment))) + if(NULL == ((*p_dst)->name_segment = H5MM_strdup(p_src->name_segment))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to duplicate name segment") } /* end if */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 1273dba..8ef776d 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -406,7 +406,7 @@ H5FD_log_fapl_copy(const void *_old_fa) /* Deep copy the log file name */ if(old_fa->logfile != NULL) - if(NULL == (new_fa->logfile = H5MM_xstrdup(old_fa->logfile))) + if(NULL == (new_fa->logfile = H5MM_strdup(old_fa->logfile))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate log file name") /* Set return value */ @@ -416,7 +416,7 @@ done: if(NULL == ret_value) if(new_fa) { if(new_fa->logfile) - H5MM_free(new_fa->logfile); + new_fa->logfile = H5MM_xfree(new_fa->logfile); H5MM_free(new_fa); } /* end if */ @@ -445,7 +445,7 @@ H5FD_log_fapl_free(void *_fa) /* Free the fapl information */ if(fa->logfile) - H5MM_xfree(fa->logfile); + fa->logfile = H5MM_xfree(fa->logfile); H5MM_xfree(fa); FUNC_LEAVE_NOAPI(SUCCEED) @@ -594,7 +594,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* Get the flags for logging */ file->fa.flags = fa->flags; if(fa->logfile) - file->fa.logfile = HDstrdup(fa->logfile); + file->fa.logfile = H5MM_strdup(fa->logfile); else file->fa.logfile = NULL; file->fa.buf_size = fa->buf_size; @@ -798,10 +798,8 @@ H5FD_log_close(H5FD_t *_file) HDfclose(file->logfp); } /* end if */ - if(file->fa.logfile) { - HDfree(file->fa.logfile); - file->fa.logfile = NULL; - } + if(file->fa.logfile) + file->fa.logfile = H5MM_xfree(file->fa.logfile); /* Release the file info */ file = H5FL_FREE(H5FD_log_t, file); diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index b1d38f4..a8ee440 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -485,7 +485,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, /* Allocate memory for "deleted" array. This array marks the message in * the source that shouldn't be copied to the destination. */ - if(NULL == (deleted = (hbool_t *)HDmalloc(sizeof(hbool_t) * oh_src->nmesgs))) + if(NULL == (deleted = (hbool_t *)H5MM_malloc(sizeof(hbool_t) * oh_src->nmesgs))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") HDmemset(deleted, FALSE, sizeof(hbool_t) * oh_src->nmesgs); @@ -892,7 +892,7 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, done: /* Free deleted array */ if(deleted) - HDfree(deleted); + H5MM_free(deleted); /* Release pointer to source object header and its derived objects */ if(oh_src && H5O_unprotect(oloc_src, dxpl_id, oh_src, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index c6a8f9a..03a4668 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -2227,9 +2227,9 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name, HDmemset(ent, 0, sizeof(H5O_storage_virtual_ent_t)); /* Clear before starting to set up */ if(NULL == (ent->source_dset.virtual_select = H5S_copy(vspace, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy virtual selection") - if(NULL == (ent->source_file_name = HDstrdup(src_file_name))) + if(NULL == (ent->source_file_name = H5MM_xstrdup(src_file_name))) HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't duplicate source file name") - if(NULL == (ent->source_dset_name = HDstrdup(src_dset_name))) + if(NULL == (ent->source_dset_name = H5MM_xstrdup(src_dset_name))) HGOTO_ERROR(H5E_PLIST, H5E_RESOURCE, FAIL, "can't duplicate source file name") if(NULL == (ent->source_select = H5S_copy(src_space, FALSE, TRUE))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, FAIL, "unable to copy source selection") |