[svn-r28992] HDFFV-9639: double-free fix.

This commit is contained in:
Allen Byrne
2016-01-27 15:43:06 -05:00
parent c5fdcb544d
commit c07c6e098a
4 changed files with 27 additions and 5 deletions

View File

@@ -1245,6 +1245,7 @@
./tools/testfiles/filter_fail.h5
./tools/testfiles/filter_fail.ddl
./tools/testfiles/h5dump-help.txt
./tools/testfiles/non_existing.ddl
./tools/testfiles/packedbits.ddl
./tools/testfiles/taindices.h5
./tools/testfiles/tall-1.ddl
@@ -1501,6 +1502,7 @@
# h5dump test error files
./tools/h5dump/errfiles/filter_fail.err
./tools/h5dump/errfiles/non_existing.err
./tools/h5dump/errfiles/tall-1.err
./tools/h5dump/errfiles/tall-2A.err
./tools/h5dump/errfiles/tall-2A0.err

View File

@@ -11,6 +11,7 @@
set (HDF5_REFERENCE_FILES
${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/non_existing.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl
@@ -282,6 +283,7 @@
)
set (HDF5_ERROR_REFERENCE_TEST_FILES
${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err
${PROJECT_SOURCE_DIR}/errfiles/non_existing.err
${PROJECT_SOURCE_DIR}/errfiles/tall-1.err
${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err
${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err
@@ -734,6 +736,8 @@
charsets.out.err
filter_fail.out
filter_fail.out.err
non_existing.out
non_existing.out.err
packedbits.out
packedbits.out.err
tall-1.out
@@ -1425,3 +1429,6 @@
# test for -o -y for dataset with attributes
ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o)
# test for non-existing file
ADD_H5_TEST (non_existing 1 --enable-error-stack tgroup.h5 non_existing.h5)

View File

@@ -1581,10 +1581,14 @@ main(int argc, const char *argv[])
if (H5Fclose(fid) < 0)
h5tools_setstatus(EXIT_FAILURE);
if(prefix)
if(prefix) {
HDfree(prefix);
if(fname)
prefix = NULL;
}
if(fname) {
HDfree(fname);
fname = NULL;
}
} /* end while */
if(hand)
@@ -1601,11 +1605,15 @@ done:
if(fid >=0)
if (H5Fclose(fid) < 0)
h5tools_setstatus(EXIT_FAILURE);
if(prefix)
if(prefix) {
HDfree(prefix);
if(fname)
prefix = NULL;
}
if(fname) {
HDfree(fname);
fname = NULL;
}
if(hand)
free_handler(hand, argc);

View File

@@ -174,6 +174,7 @@ $SRC_H5DUMP_TESTFILES/tvms.h5
LIST_OTHER_TEST_FILES="
$SRC_H5DUMP_TESTFILES/charsets.ddl
$SRC_H5DUMP_TESTFILES/filter_fail.ddl
$SRC_H5DUMP_TESTFILES/non_existing.ddl
$SRC_H5DUMP_TESTFILES/packedbits.ddl
$SRC_H5DUMP_TESTFILES/tall-1.ddl
$SRC_H5DUMP_TESTFILES/tall-2.ddl
@@ -345,6 +346,7 @@ $SRC_H5DUMP_TESTFILES/tbinregR.exp
LIST_ERROR_TEST_FILES="
${SRC_H5DUMP_ERRORFILES}/filter_fail.err
${SRC_H5DUMP_ERRORFILES}/non_existing.err
${SRC_H5DUMP_ERRORFILES}/tall-1.err
${SRC_H5DUMP_ERRORFILES}/tall-2A.err
${SRC_H5DUMP_ERRORFILES}/tall-2A0.err
@@ -1303,6 +1305,9 @@ TOOLTEST5 filter_fail.ddl --enable-error-stack filter_fail.h5
# test for -o -y for dataset with attributes
TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5
# test for non-existing file
TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR