diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2014-03-31 23:35:09 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2014-03-31 23:35:09 (GMT) |
commit | d01ee66666f4cad8e5f3f67a51a5774adcc03e45 (patch) | |
tree | 1980b2237af734a2784314b85a8b8f4edbfcf14e /hl | |
parent | ef9db69bf33a200f81ebb3e29dbcbbdab92938cf (diff) | |
download | hdf5-d01ee66666f4cad8e5f3f67a51a5774adcc03e45.zip hdf5-d01ee66666f4cad8e5f3f67a51a5774adcc03e45.tar.gz hdf5-d01ee66666f4cad8e5f3f67a51a5774adcc03e45.tar.bz2 |
[svn-r24937] Adds an H5free_memory() function to the library for use with
functions that return library-allocated memory. The test and tool
code were modified to use this new function where it's appropriate.
Fixes HDFFV-7710, HDFFV-8519, and HDFFV-8551
Tested on:
64-bit Windows 7 w/ VS2012
32-bit LE linux w/ parallel and fortran (jam)
32-bit LE linux w/ fortran and C++ (jam)
Diffstat (limited to 'hl')
-rw-r--r-- | hl/src/H5LT.c | 6 | ||||
-rw-r--r-- | hl/src/H5TB.c | 30 | ||||
-rw-r--r-- | hl/test/test_lite.c | 12 |
3 files changed, 24 insertions, 24 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index aabd828..6003c60 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -2359,7 +2359,7 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) /* Release resources */ for(i = 0; i < nmembs; i++) - HDfree(name[i]); + H5free_memory(name[i]); HDfree(name); HDfree(value); @@ -2744,7 +2744,7 @@ next: if(tag) { HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); if(tag) - HDfree(tag); + H5free_memory(tag); tag = NULL; } else HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); @@ -2950,7 +2950,7 @@ next: if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; if(mname) - HDfree(mname); + H5free_memory(mname); mname = NULL; HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 1547e00..99860b8 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -196,7 +196,7 @@ herr_t H5TBmake_table( const char *table_title, if (H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0) goto out; - HDfree( member_name ); + H5free_memory( member_name ); } @@ -234,7 +234,7 @@ herr_t H5TBmake_table( const char *table_title, if (H5Aclose(attr_id) < 0) goto out; - HDfree(member_name); + H5free_memory(member_name); } /* terminate access to the data space. */ @@ -570,7 +570,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, goto out; } - HDfree( member_name ); + H5free_memory( member_name ); } @@ -734,7 +734,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, if(H5Tclose( nmtype_id ) < 0) goto out; - HDfree( member_name ); + H5free_memory( member_name ); } @@ -1059,7 +1059,7 @@ herr_t H5TBread_fields_name( hid_t loc_id, goto out; j++; } - HDfree( member_name ); + H5free_memory( member_name ); } /* get the dataspace handle */ @@ -1221,7 +1221,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, if (H5Tclose( nmtype_id ) < 0) goto out; - HDfree( member_name ); + H5free_memory( member_name ); } /* get the dataspace handle */ @@ -2314,7 +2314,7 @@ herr_t H5TBinsert_field( hid_t loc_id, curr_offset += member_size; - HDfree( member_name ); + H5free_memory( member_name ); /* close the member type */ if(H5Tclose( member_type_id ) < 0) @@ -2694,13 +2694,13 @@ herr_t H5TBdelete_field( hid_t loc_id, if (H5Tclose( member_type_id ) < 0) goto out; - HDfree( member_name ); + H5free_memory( member_name ); break; } - HDfree( member_name ); + H5free_memory( member_name ); } /* i */ @@ -2742,7 +2742,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* we want to skip the field to delete */ if (H5TB_find_field( member_name, field_name ) > 0 ) { - HDfree( member_name ); + H5free_memory( member_name ); continue; } @@ -2780,7 +2780,7 @@ herr_t H5TBdelete_field( hid_t loc_id, curr_offset += member_size; - HDfree(member_name); + H5free_memory(member_name); /* close the member type */ if (H5Tclose(member_type_id) < 0) @@ -2821,7 +2821,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* skip the field to delete */ if (H5TB_find_field(member_name, field_name) > 0) { - HDfree(member_name); + H5free_memory(member_name); continue; } @@ -2881,7 +2881,7 @@ herr_t H5TBdelete_field( hid_t loc_id, goto out; /* release resources. */ - HDfree( member_name ); + H5free_memory( member_name ); HDfree ( tmp_buf ); } /* i */ @@ -3306,7 +3306,7 @@ herr_t H5TBget_field_info( hid_t loc_id, member_name = H5Tget_member_name(tid, (unsigned)i); strcpy(field_names[i], member_name); - HDfree(member_name); + H5free_memory(member_name); } /* end if */ /* get the member type */ @@ -3459,7 +3459,7 @@ herr_t H5TB_attach_attributes( const char *table_title, if (H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0) goto out; - HDfree( member_name ); + H5free_memory( member_name ); } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index bcf6663..cb13061 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1551,10 +1551,10 @@ static int test_compounds(void) if((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; if(HDstrcmp(memb_name, "i16_field")) { - HDfree(memb_name); + H5free_memory(memb_name); goto out; } - HDfree(memb_name); + H5free_memory(memb_name); if((memb_class = H5Tget_member_class(dtype, 2))<0) goto out; @@ -1619,10 +1619,10 @@ static int test_compound_bug(void) if((memb_name = H5Tget_member_name(dtype, 2)) == NULL) goto out; if(HDstrcmp(memb_name, "sub")) { - HDfree(memb_name); + H5free_memory(memb_name); goto out; } - HDfree(memb_name); + H5free_memory(memb_name); if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; @@ -1656,10 +1656,10 @@ static int test_compound_bug(void) if((memb_name = H5Tget_member_name(dtype, 1)) == NULL) goto out; if(HDstrcmp(memb_name, "desc_________________________________________________________________________________________")) { - HDfree(memb_name); + H5free_memory(memb_name); goto out; } - HDfree(memb_name); + H5free_memory(memb_name); if(H5LTdtype_to_text(dtype, NULL, H5LT_DDL, &str_len)<0) goto out; |