summaryrefslogtreecommitdiffstats
path: root/src/H5Oattr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1998-04-28 16:37:17 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1998-04-28 16:37:17 (GMT)
commitdce73e919fc77959ed7653b0ab330a6952494547 (patch)
tree032dbc23b510e29407b70b3dc5636d3de547853b /src/H5Oattr.c
parent66071d5078ad9841c8fbb430881ae2c6e059886e (diff)
downloadhdf5-dce73e919fc77959ed7653b0ab330a6952494547.zip
hdf5-dce73e919fc77959ed7653b0ab330a6952494547.tar.gz
hdf5-dce73e919fc77959ed7653b0ab330a6952494547.tar.bz2
[svn-r378] Merged Robb's and my memory leak fixes into one set of common fixes.
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r--src/H5Oattr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index 2671b38..320c713 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -95,23 +95,23 @@ H5O_attr_decode(H5F_t *f, const uint8 *p, H5HG_t __unused__ *hobj)
p+=name_len; /* advance the memory pointer */
/* decode the attribute datatype */
- if((attr->dt=(H5O_DTYPE[0].decode)(f,p,NULL))==NULL) {
+ if((attr->dt=(H5O_DTYPE->decode)(f,p,NULL))==NULL) {
HRETURN_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL,
"can't decode attribute datatype");
}
- attr->dt_size=(H5O_DTYPE[0].raw_size)(f,attr->dt);
+ attr->dt_size=(H5O_DTYPE->raw_size)(f,attr->dt);
p+=attr->dt_size;
/* decode the attribute dataspace */
attr->ds = H5MM_xcalloc(1, sizeof(H5S_t));
- if((simple=(H5O_SDSPACE[0].decode)(f,p,NULL))!=NULL) {
+ if((simple=(H5O_SDSPACE->decode)(f,p,NULL))!=NULL) {
attr->ds->type = H5S_SIMPLE;
HDmemcpy(&(attr->ds->u.simple),simple, sizeof(H5S_simple_t));
H5MM_xfree(simple);
} else {
attr->ds->type = H5S_SCALAR;
} /* end else */
- attr->ds_size=(H5O_SDSPACE[0].raw_size)(f,&(attr->ds->u.simple));
+ attr->ds_size=(H5O_SDSPACE->raw_size)(f,&(attr->ds->u.simple));
p+=attr->ds_size;
/* Compute the size of the data */
@@ -170,14 +170,14 @@ H5O_attr_encode(H5F_t *f, uint8 *p, const void *mesg)
p+=name_len;
/* encode the attribute datatype */
- if((H5O_DTYPE[0].encode)(f,p,attr->dt)<0) {
+ if((H5O_DTYPE->encode)(f,p,attr->dt)<0) {
HRETURN_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL,
"can't encode attribute datatype");
}
p+=attr->dt_size;
/* encode the attribute dataspace */
- if((H5O_SDSPACE[0].encode)(f,p,&(attr->ds->u.simple))<0) {
+ if((H5O_SDSPACE->encode)(f,p,&(attr->ds->u.simple))<0) {
HRETURN_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL,
"can't encode attribute dataspace");
}
@@ -297,7 +297,7 @@ H5O_attr_reset(void *_mesg)
if (attr) {
tmp = H5MM_xmalloc(sizeof(H5A_t));
- *tmp = *attr;
+ HDmemcpy(tmp,attr,sizeof(H5A_t));
H5A_close(tmp);
HDmemset(attr, 0, sizeof(H5A_t));
}