[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

@@ -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);