summaryrefslogtreecommitdiffstats
path: root/src/H5Pdxpl.c
diff options
context:
space:
mode:
authorLeon Arber <larber@ncsa.uiuc.edu>2006-11-08 01:52:54 (GMT)
committerLeon Arber <larber@ncsa.uiuc.edu>2006-11-08 01:52:54 (GMT)
commit77763447fdce64159edc73b02f28937a8bd4af69 (patch)
tree6a568790f006ebaea5d0a97d566cdff79c6b9749 /src/H5Pdxpl.c
parent665f42f9e0d7b84bddbca2ff45b276b45eb76654 (diff)
downloadhdf5-77763447fdce64159edc73b02f28937a8bd4af69.zip
hdf5-77763447fdce64159edc73b02f28937a8bd4af69.tar.gz
hdf5-77763447fdce64159edc73b02f28937a8bd4af69.tar.bz2
[svn-r12879] Purpose: Bug fix
Description: Fix a few memory-related bugs in the data transform code. Tested: kagiso (for real this time) w/ valgrind 3.2.1
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r--src/H5Pdxpl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 4fb2b07..84ac73c 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -573,6 +573,10 @@ H5Pset_data_transform(hid_t plist_id, const char* expression)
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ /* See if a data transform is already set, and free it if it is */
+ if(H5P_get(plist, H5D_XFER_XFORM_NAME, &data_xform_prop) >= 0)
+ H5Z_xform_destroy(data_xform_prop);
+
/* Create data transform info from expression */
if(NULL == (data_xform_prop = H5Z_xform_create(expression)))
HGOTO_ERROR(H5E_PLINE, H5E_NOSPACE, FAIL, "unable to create data transform info")