summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:21:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:21:31 (GMT)
commit050dd023870ac6858eaf55c20c7ffd46e97b1454 (patch)
treebd2f4bf92cedc0f45d4aa68d008ff03d05c56e07 /src
parent102337449220dfc29be1cce29147704b9c760832 (diff)
downloadhdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.zip
hdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.tar.gz
hdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.tar.bz2
[svn-r27771] Description:
Merge in part of Neil's property list fixes: Fix a minor memory leak, add some sanity checks, clean up the code a little, and verify that encoding/ decoding default versions of the property lists works correctly. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest)
Diffstat (limited to 'src')
-rw-r--r--src/H5Pdapl.c2
-rw-r--r--src/H5Pocpl.c3
-rw-r--r--src/H5Pocpypl.c8
3 files changed, 12 insertions, 1 deletions
diff --git a/src/H5Pdapl.c b/src/H5Pdapl.c
index 833f3f0..7b5108a 100644
--- a/src/H5Pdapl.c
+++ b/src/H5Pdapl.c
@@ -283,5 +283,5 @@ H5Pget_chunk_cache(hid_t dapl_id, size_t *rdcc_nslots, size_t *rdcc_nbytes, doub
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Pget_chunk_cache */
diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c
index 08eba3d..1975283 100644
--- a/src/H5Pocpl.c
+++ b/src/H5Pocpl.c
@@ -1640,6 +1640,9 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value)
/* Add the filter to the I/O pipeline */
if(H5Z_append(pline, filter.id, filter.flags, filter.cd_nelmts, filter.cd_values) < 0)
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add filter to pipeline")
+
+ /* Free cd_values, if it was allocated */
+ filter.cd_values = (unsigned *)H5MM_xfree(filter.cd_values);
} /* end for */
done:
diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c
index 08db49f..4a47dbc 100644
--- a/src/H5Pocpypl.c
+++ b/src/H5Pocpypl.c
@@ -296,6 +296,9 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value)
HDassert(pp);
HDassert(*pp);
HDassert(dt_list);
+
+ /* Start off with NULL (default value) */
+ *dt_list = NULL;
/* Decode the string sequence */
len = HDstrlen(*(const char **)pp);
@@ -440,6 +443,9 @@ H5P__ocpy_merge_comm_dt_list_cmp(const void *_dt_list1, const void *_dt_list2,
/* Walk through the lists, comparing each path. For the lists to be the
* same, the paths must be in the same order. */
while(dt_list1 && dt_list2) {
+ HDassert(dt_list1->path);
+ HDassert(dt_list2->path);
+
/* Compare paths */
ret_value = HDstrcmp(dt_list1->path, dt_list2->path);
if(ret_value != 0) HGOTO_DONE(ret_value)
@@ -602,6 +608,8 @@ H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path)
/* Check parameters */
if(!path)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no path specified")
+ if(path[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "path is empty string")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))