summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 71d083d..a5a2349 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -190,8 +190,10 @@ hatom_t H5D_find_name(hatom_t grp_id, hobjtype_t type, const char *name)
HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL);
/* Get the dataset's type (currently only atomic types) */
- if (NULL==(dset->type=H5O_read (dset->file, dset->ent.header, &(dset->ent),
- H5O_SIM_DTYPE, 0, NULL)))
+ if((dset->type=HDmalloc(sizeof(h5_datatype_t)))==NULL)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL);
+ if (NULL==H5O_read (dset->file, dset->ent.header, &(dset->ent),
+ H5O_SIM_DTYPE, 0, dset->type))
HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL);
/* Get the dataset's dimensionality (currently only simple dataspaces) */