summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-04-02 19:01:03 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-04-02 19:01:03 (GMT)
commitbe81aef60fc799b47aec3258d5d6caea8ee510ad (patch)
tree812cca77f20e12d0c0167855f6e0040313ded390 /src/H5S.c
parent27d820b8ced76eab5ca70304df51a0965c139e5b (diff)
downloadhdf5-be81aef60fc799b47aec3258d5d6caea8ee510ad.zip
hdf5-be81aef60fc799b47aec3258d5d6caea8ee510ad.tar.gz
hdf5-be81aef60fc799b47aec3258d5d6caea8ee510ad.tar.bz2
[svn-r26708] Port r26301 from trunk to 1.8 branch.
Tested: jam, koala, ostrich (h5committest) Log from r26633: Description: Bring Neil's fix for error in H5S_extent_copy() back to the trunk. Tested on: Mac OSX/64 10.10.2 (amazon) w/serial (h5committest forthcoming)
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 7279d22..88af6e0 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -509,6 +509,10 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max)
FUNC_ENTER_NOAPI(FAIL)
+ /* Release destination extent before we copy over it */
+ if(H5S_extent_release(dst) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent")
+
/* Copy the regular fields */
dst->type = src->type;
dst->version = src->version;
@@ -583,7 +587,7 @@ H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max)
FUNC_ENTER_NOAPI(NULL)
- if(NULL == (dst = H5FL_MALLOC(H5S_t)))
+ if(NULL == (dst = H5FL_CALLOC(H5S_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
/* Copy the source dataspace's extent */