summaryrefslogtreecommitdiffstats
path: root/tools/src/h5diff/h5diff_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/h5diff/h5diff_main.c')
-rw-r--r--tools/src/h5diff/h5diff_main.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/tools/src/h5diff/h5diff_main.c b/tools/src/h5diff/h5diff_main.c
index c5a0cbf..33d6570 100644
--- a/tools/src/h5diff/h5diff_main.c
+++ b/tools/src/h5diff/h5diff_main.c
@@ -69,10 +69,7 @@
int main(int argc, const char *argv[])
{
int ret;
- H5E_auto2_t func;
- H5E_auto2_t tools_func;
- void *edata;
- void *tools_edata;
+ int i;
const char *fname1 = NULL;
const char *fname2 = NULL;
const char *objname1 = NULL;
@@ -83,27 +80,17 @@ int main(int argc, const char *argv[])
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
- /* Disable error reporting */
- H5Eget_auto2(H5E_DEFAULT, &func, &edata);
- H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
-
/* Initialize h5tools lib */
h5tools_init();
- /* Disable tools error reporting */
- H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata);
- H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL);
-
/*-------------------------------------------------------------------------
* process the command-line
*-------------------------------------------------------------------------
*/
parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &opts);
- if (enable_error_stack > 0) {
- H5Eset_auto2(H5E_DEFAULT, func, edata);
- H5Eset_auto2(H5tools_ERR_STACK_g, tools_func, tools_edata);
- }
+ /* enable error reporting if command line option */
+ h5tools_error_report();
/*-------------------------------------------------------------------------
* do the diff
@@ -130,6 +117,23 @@ int main(int argc, const char *argv[])
if (opts.err_stat)
ret = 2;
+ /* free any buffers */
+ for (i = 0; i < 2; i++) {
+ if (opts.sset[i]) {
+ if(opts.sset[i]->start.data)
+ HDfree(opts.sset[i]->start.data);
+ if(opts.sset[i]->stride.data)
+ HDfree(opts.sset[i]->stride.data);
+ if(opts.sset[i]->count.data)
+ HDfree(opts.sset[i]->count.data);
+ if(opts.sset[i]->block.data)
+ HDfree(opts.sset[i]->block.data);
+
+ HDfree(opts.sset[i]);
+ opts.sset[i]=NULL;
+ }
+ }
+
h5diff_exit(ret);
}