mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[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...
This commit is contained in:
parent
85af38c6a1
commit
ed49824fe4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user