summaryrefslogtreecommitdiffstats
path: root/src/H5T.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5T.c')
-rw-r--r--src/H5T.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 9662983..bf6a209 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -2959,7 +2959,7 @@ H5T_open (H5G_entry_t *ent, hid_t dxpl_id)
{
shared_fo->fo_count++;
- if(NULL == (dt = H5FL_CALLOC(H5T_t)))
+ if(NULL == (dt = H5FL_MALLOC(H5T_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for datatype")
dt->shared=shared_fo;
@@ -3012,15 +3012,9 @@ H5T_open_oid (H5G_entry_t *ent, hid_t dxpl_id)
assert (ent);
- if(NULL==(dt=H5FL_CALLOC(H5T_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
- if(NULL==(dt->shared=H5FL_MALLOC(H5T_shared_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
-
if (H5O_open (ent)<0)
HGOTO_ERROR (H5E_DATATYPE, H5E_CANTOPENOBJ, NULL, "unable to open named data type");
- /* The fourth argument to H5O_read is dt because we've already CALLOC'ed memory for it */
- if (NULL==(dt=H5O_read (ent, H5O_DTYPE_ID, 0, dt, dxpl_id)))
+ if (NULL==(dt=H5O_read (ent, H5O_DTYPE_ID, 0, NULL, dxpl_id)))
HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to load type message from object header");
/* Mark the type as named and open */
@@ -3568,10 +3562,7 @@ H5T_set_size(H5T_t *dt, size_t size)
}
}
- if((memb_type = H5T_get_member_type(dt, max_index))==NULL)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get type of member");
-
- max_size = H5T_get_size(memb_type);
+ max_size = H5T_get_member_size(dt, max_index);
if(size<(max_offset+max_size))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member ");