summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_dset.c5
-rw-r--r--tools/lib/h5tools.c11
-rw-r--r--tools/lib/h5tools_error.h2
3 files changed, 8 insertions, 10 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index ad9331d..2cc84ca 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -545,11 +545,6 @@ hsize_t diff_datasetid( hid_t did1,
} /* elmtno */
H5Sclose(sm_space);
- /* free */
- HDfree(sm_buf1);
- sm_buf1 = NULL;
- HDfree(sm_buf2);
- sm_buf2 = NULL;
} /* hyperslab read */
}/*can_compare*/
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 8263909..7f1019a 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -2070,6 +2070,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
H5E_THROW(H5E_tools_g, H5E_tools_min_id_g, "H5Sclose failed");
if(sm_buf)
HDfree(sm_buf);
+ sm_buf = NULL;
}
else
H5E_THROW(SUCCEED, H5E_tools_min_id_g, "nothing to print");
@@ -2081,6 +2082,9 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
} /* hyperslab_count loop */
CATCH
+ if(sm_buf)
+ HDfree(sm_buf);
+
return ret_value;
}
@@ -3285,7 +3289,7 @@ h5tools_print_enum(h5tools_str_t *buffer, hid_t type)
char **name = NULL; /*member names */
unsigned char *value = NULL; /*value array */
unsigned char *copy = NULL; /*a pointer to value array */
- unsigned nmembs; /*number of members */
+ unsigned nmembs = 0; /*number of members */
int nchars; /*number of output characters */
hid_t super = -1; /*enum base integer type */
hid_t native = -1; /*native integer datatype */
@@ -3379,10 +3383,9 @@ h5tools_print_enum(h5tools_str_t *buffer, hid_t type)
}
CATCH
-
if(name) {
/* Release resources */
- for (i = 0; i < nmembs; i++)
+ for(i = 0; i < nmembs; i++)
if(name[i])
free(name[i]);
free(name);
@@ -3394,7 +3397,7 @@ CATCH
if(super >= 0 && H5Tclose(super) < 0)
H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class");
- if (0 == nmembs)
+ if(0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
return ret_value;
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index da8f03c..dc5f87b 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -71,7 +71,7 @@ extern hid_t H5E_tools_min_id_g;
/* Macro for "catching" flow of control when an error occurs. Note that the
* H5_LEAVE macro won't jump back here once it's past this point.
*/
-#define CATCH past_catch = TRUE; catch_except:;
+#define CATCH catch_except:; past_catch = TRUE;
/*
* H5_LEAVE macro, used to facilitate control flow between a