diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2016-04-29 19:06:36 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2016-04-29 19:06:36 (GMT) |
commit | 4bbde7895e409ea9bbcab28a8d839284c114208d (patch) | |
tree | 39d1f0443ac553c8e156069702ba6867316d60ca /src | |
parent | 22d058d32e0403d7fe766281b60898efaed6e94c (diff) | |
download | hdf5-4bbde7895e409ea9bbcab28a8d839284c114208d.zip hdf5-4bbde7895e409ea9bbcab28a8d839284c114208d.tar.gz hdf5-4bbde7895e409ea9bbcab28a8d839284c114208d.tar.bz2 |
[svn-r29837] Partial fix for Valgrind issue in test/external.c
Tested on: 64-bit Ubuntu 15.10 w/ gcc 5.2.1
autotools serial
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dint.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index 0e0843f..3d20e53 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -926,6 +926,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix size_t extpath_len; /* length of extpath */ size_t prefix_len; /* length of prefix */ size_t extfile_prefix_len; /* length of expanded prefix */ + hbool_t free_prefix = FALSE; /* Did the library allocate memory for prefix? */ H5P_genplist_t *plist = NULL; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -949,6 +950,7 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* No error checking possible here */ prefix = (char *)H5P_peek_voidp(plist, H5D_ACS_EFILE_PREFIX_NAME); + free_prefix = TRUE; } /* end if */ /* Prefix has to be checked for NULL / empty string again because the @@ -979,6 +981,8 @@ H5D_build_extfile_prefix(const H5D_t *dset, hid_t dapl_id, char **extfile_prefix } /* end else */ done: + if(free_prefix && prefix) + H5MM_xfree(prefix); FUNC_LEAVE_NOAPI(ret_value) } /* H5D_build_extfile_prefix() */ |