diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-08 23:29:49 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-08 23:29:49 (GMT) |
commit | 2104bd1e0a85c01a871910803883637f48ac2573 (patch) | |
tree | 7eb3f70b5981be590582805aac655929b941eeaf /src/H5SMcache.c | |
parent | d978a22b36d148a17f331eb51d0e13ede524770a (diff) | |
download | hdf5-2104bd1e0a85c01a871910803883637f48ac2573.zip hdf5-2104bd1e0a85c01a871910803883637f48ac2573.tar.gz hdf5-2104bd1e0a85c01a871910803883637f48ac2573.tar.bz2 |
[svn-r13122] Description:
Add more tests for attributes with shared components.
Close memory leak in shared message table loading.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5SMcache.c')
-rw-r--r-- | src/H5SMcache.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5SMcache.c b/src/H5SMcache.c index 5e8f58f..70f6177 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -122,7 +122,7 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma HDassert(H5F_addr_defined(addr)); HDassert(table); - if (table->cache_info.is_dirty) { + if(table->cache_info.is_dirty) { uint8_t *buf; /* Temporary buffer */ uint8_t *p; /* Pointer into raw data buffer */ size_t size; /* Header size on disk */ @@ -133,7 +133,7 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma size = H5SM_TABLE_SIZE(f) + (H5SM_INDEX_HEADER_SIZE(f) * table->num_indexes); /* Allocate the buffer */ /* JAMES: use H5FL_BLK_MALLOC instead? */ - if(NULL == (buf = HDmalloc(size))) + if(NULL == (buf = H5MM_malloc(size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Encode the master table */ @@ -168,7 +168,10 @@ H5SM_flush_table(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5SM_ma HGOTO_ERROR(H5E_SOHM, H5E_CANTFLUSH, FAIL, "unable to save sohm table to disk") table->cache_info.is_dirty = FALSE; - } + + /* Free buffer */ + H5MM_xfree(buf); + } /* end if */ if(destroy) if(H5SM_dest_table(f, table) < 0) |