diff options
author | Mike McGreevy <mamcgree@hdfgroup.org> | 2008-06-09 18:28:37 (GMT) |
---|---|---|
committer | Mike McGreevy <mamcgree@hdfgroup.org> | 2008-06-09 18:28:37 (GMT) |
commit | 32f3fe6586828a0a04263bb34464b6ea0057900b (patch) | |
tree | ecfb4f43d9a74e0c08099444d18d403e211a3a97 /src/H5C2journal.c | |
parent | ec09c59c12356423efc8dc512de2d49c551af67d (diff) | |
download | hdf5-32f3fe6586828a0a04263bb34464b6ea0057900b.zip hdf5-32f3fe6586828a0a04263bb34464b6ea0057900b.tar.gz hdf5-32f3fe6586828a0a04263bb34464b6ea0057900b.tar.bz2 |
[svn-r15182] Purpose: Bug Fix
Description: Changed H5C2_jb__journal_entry function to make a copy of the
incoming journal entry before doing anything with it. I was seeing
errors in the journals produced by using the pointer passed to me,
so copying the data beforehand looks to solve the problem.
Also made a quick change to h5recover.c to use generated fapl
when opening the recovered HDF5 file. (was previously using
H5P_DEFAULT).
Tested: kagiso
Diffstat (limited to 'src/H5C2journal.c')
-rw-r--r-- | src/H5C2journal.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/H5C2journal.c b/src/H5C2journal.c index 7e812de..7b0bfa1 100644 --- a/src/H5C2journal.c +++ b/src/H5C2journal.c @@ -2890,6 +2890,7 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, char * hexdata = NULL; size_t hexlength; herr_t ret_value = SUCCEED; + uint8_t * bodydata = strdup(body); FUNC_ENTER_NOAPI(H5C2_jb__journal_entry, FAIL) #if 0 /* JRM */ @@ -2898,7 +2899,7 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, #endif /* JRM */ /* Check Arguments */ HDassert(struct_ptr); - HDassert(body); + HDassert(bodydata); HDassert(struct_ptr->magic == H5C2__H5C2_JBRB_T_MAGIC); /* Verify that the supplied transaction is in progress */ @@ -2936,7 +2937,7 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, } /* end if */ /* Convert data from binary to hex */ - H5C2_jb__bin2hex(body, hexdata, &hexlength, length); + H5C2_jb__bin2hex(bodydata, hexdata, &hexlength, length); if ( H5C2_jb__write_to_buffer(struct_ptr, hexlength, hexdata, FALSE, trans_num) < 0 ) { @@ -2954,6 +2955,16 @@ H5C2_jb__journal_entry(H5C2_jbrb_t * struct_ptr, done: + if ( bodydata != NULL ) + { + bodydata = H5MM_xfree(bodydata); + if ( bodydata != NULL ) { + + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, \ + "free of assembly buffer failed."); + } + } + if ( temp != NULL ) { temp = H5MM_xfree(temp); |