summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-09-16 21:37:44 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-09-16 21:37:44 (GMT)
commited49824fe4d4ff6b5f94d490654ada30996db939 (patch)
treed073503b0991a3f3ba72834f11d878fad1f2f41b
parent85af38c6a1b3107fb005c6f8e874cbc5ae9c8e37 (diff)
downloadhdf5-ed49824fe4d4ff6b5f94d490654ada30996db939.zip
hdf5-ed49824fe4d4ff6b5f94d490654ada30996db939.tar.gz
hdf5-ed49824fe4d4ff6b5f94d490654ada30996db939.tar.bz2
[svn-r92] It was quite simple, actually. The H5O_sim_dim_fast() should allocate
space for the result if it gets the null pointer. See H5O_stab_fast() for an example. I notice that some where is something beging freed twice...
-rw-r--r--src/H5Osdim.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/H5Osdim.c b/src/H5Osdim.c
index 1d44f71..2d578a2 100644
--- a/src/H5Osdim.c
+++ b/src/H5Osdim.c
@@ -217,20 +217,16 @@ H5O_sim_dim_fast (const H5G_entry_t *ent, void *mesg)
/* check args */
assert (ent);
- assert (mesg);
if (H5G_CACHED_SDATA==ent->type)
{
- if (!sdim)
- if((sdim = H5MM_xcalloc (1, sizeof(H5O_sim_dim_t)))!=NULL)
- {
- p=(const uint8 *)&ent->cache.sdata.ndim;
- UINT32DECODE(p,sdim->rank);
- sdim->dim_flags=0; /* cached dimensions never have max. dims or permutation vectors */
- sdim->size=H5MM_xmalloc(sizeof(uint32)*sdim->rank);
- for(u=0; u<sdim->rank; u++)
- UINT32DECODE(p,sdim->size[u]);
- } /* end if */
+ if (!sdim) sdim = H5MM_xcalloc (1, sizeof(H5O_sim_dim_t));
+ p=(const uint8 *)&ent->cache.sdata.ndim;
+ UINT32DECODE(p,sdim->rank);
+ sdim->dim_flags=0; /* cached dimensions never have max. dims or permutation vectors */
+ sdim->size=H5MM_xmalloc(sizeof(uint32)*sdim->rank);
+ for(u=0; u<sdim->rank; u++)
+ UINT32DECODE(p,sdim->size[u]);
} /* end if */
else
sdim = NULL;