summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-01-05 02:46:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-01-05 02:46:26 (GMT)
commit3e0e79aa6eaa26106d22c0b860d523fe945cb0ac (patch)
tree1dc23a6c4bec8e261c461fd8d318c8100ab4cfd1
parent1cbc72e1ef6d5a0341713b4c7d8b113310a52551 (diff)
downloadhdf5-3e0e79aa6eaa26106d22c0b860d523fe945cb0ac.zip
hdf5-3e0e79aa6eaa26106d22c0b860d523fe945cb0ac.tar.gz
hdf5-3e0e79aa6eaa26106d22c0b860d523fe945cb0ac.tar.bz2
[svn-r28795] Description:
Clean up more memory allocation mis-matches. Tested on: Linux/32 2.6.x (jam) w/serial MacOSX/64 10.11.2 (amazon) w/serial & parallel
-rw-r--r--src/H5E.c5
-rw-r--r--src/H5PL.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/src/H5E.c b/src/H5E.c
index 4374f1d..efa83e4 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -1417,8 +1417,13 @@ H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line,
done:
if(va_started)
va_end(ap);
+#ifdef H5_HAVE_VASPRINTF
+ if(tmp)
+ HDfree(tmp);
+#else /* H5_HAVE_VASPRINTF */
if(tmp)
H5MM_xfree(tmp);
+#endif /* H5_HAVE_VASPRINTF */
FUNC_LEAVE_API(ret_value)
} /* end H5Epush2() */
diff --git a/src/H5PL.c b/src/H5PL.c
index 4c35c09..a196884 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -413,9 +413,9 @@ H5PL__init_path_table(void)
*/
origin_dl_path = HDgetenv("HDF5_PLUGIN_PATH");
if(NULL == origin_dl_path)
- dl_path = HDstrdup(H5PL_DEFAULT_PATH);
+ dl_path = H5MM_strdup(H5PL_DEFAULT_PATH);
else
- dl_path = HDstrdup(origin_dl_path);
+ dl_path = H5MM_strdup(origin_dl_path);
if(NULL == dl_path)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
@@ -425,7 +425,7 @@ H5PL__init_path_table(void)
/* Check for too many directories in path */
if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM)
HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table")
- if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = HDstrdup(dir)))
+ if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dir)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
H5PL_num_paths_g++;
dir = HDstrtok(NULL, H5PL_PATH_SEPARATOR);