summaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-03-25 17:49:42 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-03-25 17:49:42 (GMT)
commitb93cec6dc4f547662e3910d24054bde056290713 (patch)
tree0add2560284fe86f496d86d58bb01f086fa766c2 /tools/misc
parente9fdcdf5b6c9cf0ea0d655d7a3f271ff6a7be5e6 (diff)
downloadhdf5-b93cec6dc4f547662e3910d24054bde056290713.zip
hdf5-b93cec6dc4f547662e3910d24054bde056290713.tar.gz
hdf5-b93cec6dc4f547662e3910d24054bde056290713.tar.bz2
[svn-r23448] HDFFV-8322: valgrind leaks
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/h5mkgrp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c
index b4ac6f6..b9fb588 100644
--- a/tools/misc/h5mkgrp.c
+++ b/tools/misc/h5mkgrp.c
@@ -46,6 +46,7 @@ typedef struct {
size_t ngroups; /* Number of groups to create */
char **groups; /* Pointer to array of group names */
} param_t;
+param_t params; /* Command line parameter settings */
/*-------------------------------------------------------------------------
@@ -62,6 +63,15 @@ typedef struct {
static void
leave(int ret)
{
+ int curr_group;
+
+ if (params.fname)
+ HDfree (params.fname);
+ if (params.ngroups) {
+ for(curr_group = 0; curr_group < params.ngroups; curr_group++)
+ HDfree (params.groups[curr_group]);
+ HDfree (params.groups);
+ }
h5tools_close();
HDexit(ret);
} /* end leave() */
@@ -206,7 +216,6 @@ for(curr_group = 0; curr_group < params->ngroups; curr_group++)
int
main(int argc, const char *argv[])
{
- param_t params; /* Command line parameter settings */
hid_t fid; /* HDF5 file ID */
hid_t fapl_id; /* File access property list ID */
hid_t lcpl_id; /* Link creation property list ID */
@@ -322,6 +331,6 @@ main(int argc, const char *argv[])
/* Shut down h5tools lib */
h5tools_close();
- return EXIT_SUCCESS;
+ leave(EXIT_SUCCESS);
} /* end main() */