diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2000-11-25 22:30:59 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2000-11-25 22:30:59 (GMT) |
commit | 0cf81a0aa8fd8dc7de56d9cfeda1a587bcdf6660 (patch) | |
tree | 8cb3bdbc22d0d47acfe849f03e2e9bde47ec736b | |
parent | 203ea8443113e309df961c667c376cf3ba5fddb2 (diff) | |
download | hdf5-0cf81a0aa8fd8dc7de56d9cfeda1a587bcdf6660.zip hdf5-0cf81a0aa8fd8dc7de56d9cfeda1a587bcdf6660.tar.gz hdf5-0cf81a0aa8fd8dc7de56d9cfeda1a587bcdf6660.tar.bz2 |
[svn-r3001]
Purpose:
Fix a bug caught by debug version of windows 2000 at test_compound_5(struct optimization converter).
Description:
free memory of a variable before checking the result by using that variable.
Solution:
put free(buf) and free(bkg) after the following block:
/* Check results */
if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) ||
src[1].tdim!=dst[1].tdim ||
src[1].coll_ids[0]!=dst[1].coll_ids[0] ||
src[1].coll_ids[1]!=dst[1].coll_ids[1] ||
src[1].coll_ids[2]!=dst[1].coll_ids[2] ||
src[1].coll_ids[3]!=dst[1].coll_ids[3]) {
FAILED();
return 1;
}
Platforms tested:
windows 2000 and confirmed at LINUX(eirene).
-rw-r--r-- | test/dtypes.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/dtypes.c b/test/dtypes.c index 6f5d439..264af69 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -853,9 +853,7 @@ test_compound_5(void) H5Tclose(short_array); H5Tclose(int_array); - /* Free memory buffers */ - free(buf); - free(bkg); + /* Check results */ if (memcmp(src[1].name, dst[1].name, sizeof(src[1].name)) || @@ -867,6 +865,10 @@ test_compound_5(void) FAILED(); return 1; } + + /* Free memory buffers */ + free(buf); + free(bkg); PASSED(); return 0; } |