summaryrefslogtreecommitdiffstats
path: root/src/H5E.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-04-30 06:10:38 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-04-30 06:10:38 (GMT)
commitbd33a9d6da4f56884eaf5dc750186a6c02c90446 (patch)
tree2bb71d0ed2ebbb447c28e8e77ecf55ce01340d9f /src/H5E.c
parentf63b2c50ac95fb8363a9b8143d3a3d5f50c58d35 (diff)
downloadhdf5-bd33a9d6da4f56884eaf5dc750186a6c02c90446.zip
hdf5-bd33a9d6da4f56884eaf5dc750186a6c02c90446.tar.gz
hdf5-bd33a9d6da4f56884eaf5dc750186a6c02c90446.tar.bz2
[svn-r29842] Description:
Bring [appropriate portions of] r29811, 29813, 29826, 29830, 29831 from revise_chunks branch to the trunk. Tested on: MacOSX/64 10.11.4 (amazon) w/serial, parallel & production (h5committest forthcoming)
Diffstat (limited to 'src/H5E.c')
-rw-r--r--src/H5E.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/H5E.c b/src/H5E.c
index efa83e4..aa4511b 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -367,8 +367,12 @@ H5E_get_stack(void)
if(!estack) {
/* No associated value with current thread - create one */
#ifdef H5_HAVE_WIN_THREADS
- estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t)); /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */
+ /* Win32 has to use LocalAlloc to match the LocalFree in DllMain */
+ estack = (H5E_t *)LocalAlloc(LPTR, sizeof(H5E_t));
#else
+ /* Use HDmalloc here since this has to match the HDfree in the
+ * destructor and we want to avoid the codestack there.
+ */
estack = (H5E_t *)HDmalloc(sizeof(H5E_t));
#endif /* H5_HAVE_WIN_THREADS */
HDassert(estack);
@@ -1418,6 +1422,9 @@ done:
if(va_started)
va_end(ap);
#ifdef H5_HAVE_VASPRINTF
+ /* Memory was allocated with HDvasprintf so it needs to be freed
+ * with HDfree
+ */
if(tmp)
HDfree(tmp);
#else /* H5_HAVE_VASPRINTF */