From ed49824fe4d4ff6b5f94d490654ada30996db939 Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Tue, 16 Sep 1997 16:37:44 -0500 Subject: [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... --- src/H5Osdim.c | 18 +++++++----------- 1 file 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; urank; 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; urank; u++) + UINT32DECODE(p,sdim->size[u]); } /* end if */ else sdim = NULL; -- cgit v0.12