summaryrefslogtreecommitdiffstats
path: root/src/H5Olayout.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-01-28 13:11:38 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-01-28 13:11:38 (GMT)
commit3360c3af0c100ac4d3a2fe2865f34661da862ec5 (patch)
tree9caf7dba62679504aa39ec02ebb72d8b8b5a848d /src/H5Olayout.c
parent5b4d3279099e7e4fad6e0092c77aa93dfd35d616 (diff)
downloadhdf5-3360c3af0c100ac4d3a2fe2865f34661da862ec5.zip
hdf5-3360c3af0c100ac4d3a2fe2865f34661da862ec5.tar.gz
hdf5-3360c3af0c100ac4d3a2fe2865f34661da862ec5.tar.bz2
[svn-r18175] Description:
Bring r17986:18172 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r--src/H5Olayout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 330189c..7a15947 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -560,8 +560,10 @@ H5O_layout_copy(const void *_mesg, void *_dest)
/* check args */
HDassert(mesg);
+
+ /* Allocate destination message, if necessary */
if(!dest && NULL == (dest = H5FL_MALLOC(H5O_layout_t)))
- HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "memory allocation failed")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "layout message allocation failed")
/* copy */
*dest = *mesg;
@@ -584,6 +586,10 @@ H5O_layout_copy(const void *_mesg, void *_dest)
ret_value = dest;
done:
+ if(ret_value == NULL)
+ if(NULL == _dest)
+ dest = H5FL_FREE(H5O_layout_t, dest);
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_layout_copy() */
@@ -880,7 +886,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst,
done:
if(!ret_value)
if(layout_dst)
- (void)H5FL_FREE(H5O_layout_t, layout_dst);
+ layout_dst = H5FL_FREE(H5O_layout_t, layout_dst);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_layout_copy_file() */