summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-05-02 15:43:27 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-05-02 15:43:27 (GMT)
commit742a53e3462b64475de54a0cbb7e95f969c6299a (patch)
treeafceb21b3b505da0b2a25d39037cea4653e026a7
parent5f97b16abd7a045e3db65894856af16cec74f24e (diff)
downloadhdf5-742a53e3462b64475de54a0cbb7e95f969c6299a.zip
hdf5-742a53e3462b64475de54a0cbb7e95f969c6299a.tar.gz
hdf5-742a53e3462b64475de54a0cbb7e95f969c6299a.tar.bz2
[svn-r29854] HDFFV-9784: Fix valgrind memory leaks and update release.txt with issues.
-rw-r--r--release_docs/RELEASE.txt21
-rw-r--r--tools/lib/h5diff_attr.c59
2 files changed, 57 insertions, 23 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 1c1d465..4cc5338 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -301,14 +301,31 @@ Bug Fixes since HDF5-1.8.16
When an argument with an optional value was at the end of the command line
with a value, h5dump would crash. Reworked check for remaining arguments.
- (ADB, 2016/03/07, HDFFV-9570)
+ (ADB, 2016/03/07, HDFFV-9570, HDFFV-9684)
- h5dump issue with default fill value.
- Added all default cases of fill value to display of fill value..
+ Added all default cases of fill value to display of fill value.
(ADB, 2016/03/07, HDFFV-9241)
+ - Clarified usage of -O F option in h5dump utility help.
+
+ (ADB, 2016/03/07, HDFFV-9066)
+
+ - h5dump issue with double free fault.
+
+ Added check for filename not null before calling free().
+
+ (ADB, 2016/01/27, HDFFV-9639)
+
+ - VS2015 release changed how timezone was handled.
+
+ Created a function, HDget_timezone, in H5system.c. Replaced timezone variable
+ usage with function call.
+
+ (ADB, 2015/11/02, HDFFV-9550)
+
Fortran API
-----------
- None
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 6474082..696c77a 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -108,17 +108,25 @@ static void table_attrs_free( table_attrs_t *table )
*------------------------------------------------------------------------*/
static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table)
{
- size_t new_val;
+ size_t curr_val;
+
+ match_attr_t *new_attrs;
if(table->nattrs == table->size) {
table->size = MAX(1, table->size * 2);
- table->attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t));
+ new_attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t));
+ if(new_attrs)
+ table->attrs = new_attrs;
} /* end if */
- new_val = table->nattrs++;
- table->attrs[new_val].exist[0] = exist[0];
- table->attrs[new_val].exist[1] = exist[1];
- table->attrs[new_val].name = (char *)HDstrdup(name);
+ if(table->nattrs < table->size) {
+ curr_val = table->nattrs;
+ table->attrs[curr_val].exist[0] = exist[0];
+ table->attrs[curr_val].exist[1] = exist[1];
+ if(name)
+ table->attrs[curr_val].name = (char *)HDstrdup(name);
+ table->nattrs++;
+ }
}
/*-------------------------------------------------------------------------
@@ -377,21 +385,30 @@ hsize_t diff_attr(hid_t loc1_id,
if((attr2_id = H5Aopen(loc2_id, name2, H5P_DEFAULT)) < 0)
goto error;
- /* get the datatypes */
- if((ftype1_id = H5Aget_type(attr1_id)) < 0)
- goto error;
- vstrtype1 = H5Tis_variable_str(ftype1_id);
- if((ftype2_id = H5Aget_type(attr2_id)) < 0)
- goto error;
- vstrtype2 = H5Tis_variable_str(ftype2_id);
- /* no compare if either one but not both are variable string type */
- if (vstrtype1 != vstrtype2){
- if ((options->m_verbose||options->m_list_not_cmp))
- parallel_print("Not comparable: one of attribute <%s/%s> or <%s/%s> is of variable length type\n",
- path1, name1, path2, name2);
- options->not_cmp = 1;
- return 0;
- }
+ /* get the datatypes */
+ if ((ftype1_id = H5Aget_type(attr1_id)) < 0)
+ goto error;
+ vstrtype1 = H5Tis_variable_str(ftype1_id);
+ if ((ftype2_id = H5Aget_type(attr2_id)) < 0)
+ goto error;
+ vstrtype2 = H5Tis_variable_str(ftype2_id);
+ /* no compare if either one but not both are variable string type */
+ if (vstrtype1 != vstrtype2) {
+ if ((options->m_verbose || options->m_list_not_cmp))
+ parallel_print("Not comparable: one of attribute <%s/%s> or <%s/%s> is of variable length type\n",
+ path1, name1, path2, name2);
+ options->not_cmp = 1;
+ if (H5Tclose(ftype1_id) < 0)
+ goto error;
+ if (H5Tclose(ftype2_id) < 0)
+ goto error;
+ if (H5Aclose(attr1_id) < 0)
+ goto error;
+ if (H5Aclose(attr2_id) < 0)
+ goto error;
+ continue;
+ }
+
if((mtype1_id = h5tools_get_native_type(ftype1_id))<0)
goto error;