diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-13 19:17:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-08-13 19:17:29 (GMT) |
commit | 92b37616d2a1ec34a2d7bd34d05c5f6466f7da53 (patch) | |
tree | 782bdfeee57df4a5fc673c47c1917e92f6262468 /src/H5SM.c | |
parent | 5e435bd8ac0b1d59a2c8461b960434b49b50a25f (diff) | |
download | hdf5-92b37616d2a1ec34a2d7bd34d05c5f6466f7da53.zip hdf5-92b37616d2a1ec34a2d7bd34d05c5f6466f7da53.tar.gz hdf5-92b37616d2a1ec34a2d7bd34d05c5f6466f7da53.tar.bz2 |
[svn-r17354] Description:
Bring r17351 from trunk to 1.8 branch:
Clean up code (to align w/future sblock_mdc branch changes), tweak
tests for [slightly] easier debugging, fix memory leak when copying chunked
datasets with I/O filters, fix memory leak of free space section when it was
exactly the right size to use for extending an existing block in the file.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
(h5committest performed on trunk)
Diffstat (limited to 'src/H5SM.c')
-rwxr-xr-x | src/H5SM.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -139,10 +139,6 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d /* File should not already have a SOHM table */ HDassert(f->shared->sohm_addr == HADDR_UNDEF); - /* Initialize master table */ - if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for SOHM table") - /* Get information from fcpl */ if(H5P_get(fc_plist, H5F_CRT_SHMSG_NINDEXES_NAME, &num_indexes)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get number of indexes") @@ -167,6 +163,10 @@ H5SM_init(H5F_t *f, H5P_genplist_t * fc_plist, const H5O_loc_t *ext_loc, hid_t d type_flags_used |= index_type_flags[x]; } /* end for */ + /* Initialize master table */ + if(NULL == (table = H5FL_MALLOC(H5SM_master_table_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for SOHM table") + /* Set version and number of indexes in table and in superblock. * Right now we just use one byte to hold the number of indexes. */ @@ -235,7 +235,7 @@ done: if(table_addr != HADDR_UNDEF) H5MF_xfree(f, H5FD_MEM_SOHM_TABLE, dxpl_id, table_addr, (hsize_t)H5SM_TABLE_SIZE(f)); if(table != NULL) - (void)H5FL_FREE(H5SM_master_table_t, table); + table = H5FL_FREE(H5SM_master_table_t, table); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) |