summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-03-09 13:57:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-03-09 13:57:41 (GMT)
commita60f8c8f5ed705d281aeb70cf29d78371d3be996 (patch)
tree4804a43cfec92122cb3b4235e18f7bac9777d45b /tools
parent10aa3f98d64530c7d28882f41a220d3b59568d6a (diff)
downloadhdf5-a60f8c8f5ed705d281aeb70cf29d78371d3be996.zip
hdf5-a60f8c8f5ed705d281aeb70cf29d78371d3be996.tar.gz
hdf5-a60f8c8f5ed705d281aeb70cf29d78371d3be996.tar.bz2
[svn-r20208] Valgrind fix for memory leak in free_tables - 2nd malloc was freed by free_table calls but not the first malloc. Added HDfree('table') after each free_table() call.
Tested: local linux and valgrind
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dump.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 98bd6c9..81a6793 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -824,8 +824,11 @@ table_list_free(void)
/* Free each table */
free_table(table_list.tables[u].group_table);
+ HDfree(table_list.tables[u].group_table);
free_table(table_list.tables[u].dset_table);
+ HDfree(table_list.tables[u].dset_table);
free_table(table_list.tables[u].type_table);
+ HDfree(table_list.tables[u].type_table);
}
/* Free the table list */
@@ -4478,6 +4481,7 @@ main(int argc, const char *argv[])
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"xsi:schemaLocation=\"http://hdfgroup.org/DTDs/HDF5-File "
"http://www.hdfgroup.org/DTDs/HDF5-File.xsd\">\n",xmlnsprefix,ns);
+ HDfree(ns);
}
} else {
printf("<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n",