[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:
Robb Matzke 1997-09-16 16:37:44 -05:00
parent 85af38c6a1
commit ed49824fe4

View File

@ -217,13 +217,10 @@ H5O_sim_dim_fast (const H5G_entry_t *ent, void *mesg)
/* check args */ /* check args */
assert (ent); assert (ent);
assert (mesg);
if (H5G_CACHED_SDATA==ent->type) if (H5G_CACHED_SDATA==ent->type)
{ {
if (!sdim) if (!sdim) sdim = H5MM_xcalloc (1, sizeof(H5O_sim_dim_t));
if((sdim = H5MM_xcalloc (1, sizeof(H5O_sim_dim_t)))!=NULL)
{
p=(const uint8 *)&ent->cache.sdata.ndim; p=(const uint8 *)&ent->cache.sdata.ndim;
UINT32DECODE(p,sdim->rank); UINT32DECODE(p,sdim->rank);
sdim->dim_flags=0; /* cached dimensions never have max. dims or permutation vectors */ sdim->dim_flags=0; /* cached dimensions never have max. dims or permutation vectors */
@ -231,7 +228,6 @@ H5O_sim_dim_fast (const H5G_entry_t *ent, void *mesg)
for(u=0; u<sdim->rank; u++) for(u=0; u<sdim->rank; u++)
UINT32DECODE(p,sdim->size[u]); UINT32DECODE(p,sdim->size[u]);
} /* end if */ } /* end if */
} /* end if */
else else
sdim = NULL; sdim = NULL;