diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2019-07-02 14:26:55 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2019-07-02 14:26:55 (GMT) |
commit | d0bc570c2cdc4cbbb42cc1d4dac61aba67e20892 (patch) | |
tree | 5651d10a62c1bb10f9dca96eabb85cb47ba382ab /src | |
parent | f97ea92fe5450cefd4c4d9fb266e7f42a952f2f9 (diff) | |
parent | f250815151df8da8a93c0ff781a3cf134f1c6cbd (diff) | |
download | hdf5-d0bc570c2cdc4cbbb42cc1d4dac61aba67e20892.zip hdf5-d0bc570c2cdc4cbbb42cc1d4dac61aba67e20892.tar.gz hdf5-d0bc570c2cdc4cbbb42cc1d4dac61aba67e20892.tar.bz2 |
Merge pull request #1787 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop_minor_pr to develop
* commit 'f250815151df8da8a93c0ff781a3cf134f1c6cbd':
Cleaned up misc warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDlog.c | 12 | ||||
-rw-r--r-- | src/H5FSsection.c | 2 | ||||
-rw-r--r-- | src/H5Pfapl.c | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 06a0e61..ac5667f 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -331,16 +331,22 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned long long flags, si HDmemset(&fa, 0, sizeof(H5FD_log_fapl_t)); - /* This shallow copy is correct! The string will be properly - * copied deep down in the H5P code. + /* Duplicate the log file string + * A little wasteful, since this string will just be copied later, but + * passing it in as a pointer sets off a chain of impossible-to-resolve + * const cast warnings. */ - fa.logfile = (char *)logfile; + if(logfile != NULL && NULL == (fa.logfile = H5MM_xstrdup(logfile))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to copy log file name") fa.flags = flags; fa.buf_size = buf_size; ret_value = H5P_set_driver(plist, H5FD_LOG, &fa); done: + if(fa.logfile) + H5MM_free(fa.logfile); + FUNC_LEAVE_API(ret_value) } /* end H5Pset_fapl_log() */ diff --git a/src/H5FSsection.c b/src/H5FSsection.c index d15e299..9f86aea 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -2539,7 +2539,7 @@ H5FS_vfd_alloc_hdr_and_section_info_if_needed(H5F_t *f, H5FS_t *fspace, /* Allocate space for the free space header */ if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, hdr_alloc_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for free space header") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for free space header") /* Cache the new free space header (pinned) */ if(H5AC_insert_entry(f, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 585e913..8bb2b12 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4892,7 +4892,7 @@ H5P_set_vol(H5P_genplist_t *plist, hid_t vol_id, const void *vol_info) /* Prepare the VOL connector property */ vol_prop.connector_id = vol_id; - vol_prop.connector_info = vol_info; + vol_prop.connector_info = (void *)vol_info; /* Set the connector ID & info property */ if(H5P_set(plist, H5F_ACS_VOL_CONN_NAME, &vol_prop) < 0) |