diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-10-13 09:33:03 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-10-13 09:33:03 (GMT) |
commit | b767c1a0ae221b4d39cead548bd26a229a8529c9 (patch) | |
tree | 452bd065fea24fa0b3d0bbfe5d26f61812bb8948 /hl | |
parent | 76ff9fa1d25f2f060b6ef620a9c6d1a1652c6fa8 (diff) | |
download | hdf5-b767c1a0ae221b4d39cead548bd26a229a8529c9.zip hdf5-b767c1a0ae221b4d39cead548bd26a229a8529c9.tar.gz hdf5-b767c1a0ae221b4d39cead548bd26a229a8529c9.tar.bz2 |
[svn-r28049] Merge of r27997-28047 from the trunk.
Tested on: Ubuntu 15.04 (Linux 3.19 x86_64) gcc 4.9.2
serial w/ Fortran and C++
parallel (MPICH 3.1.4) w/ Fortran
Diffstat (limited to 'hl')
-rw-r--r-- | hl/src/H5LTparse.y | 13 | ||||
-rw-r--r-- | hl/test/test_lite.c | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index 4c07533..9f08254 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -190,7 +190,10 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le H5Tinsert(dtype_id, $<sval>4, $<ival>6, $<hid>1); } } - + if($<sval>4) { + free($<sval>4); + $<sval>4 = NULL; + } cmpd_stack[csindex].is_field = 0; H5Tclose($<hid>1); @@ -199,7 +202,9 @@ memb_def : ddl_type { cmpd_stack[csindex].is_field = 1; /*notify le ; field_name : STRING { - $<sval>$ = yylval.sval; + $<sval>$ = strdup(yylval.sval); + free(yylval.sval); + yylval.sval = NULL; } ; field_offset : /*empty*/ @@ -247,6 +252,8 @@ opaque_type : H5T_OPAQUE_TOKEN OPQ_TAG_TOKEN { is_opq_tag = 1; } '"' opaque_tag '"' ';' { H5Tset_tag($<hid>7, yylval.sval); + free(yylval.sval); + yylval.sval = NULL; is_opq_tag = 0; } '}' { $<hid>$ = $<hid>7; } @@ -335,6 +342,8 @@ enum_def : '"' enum_symbol '"' { #else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); #endif /* H5_HAVE_WIN32_API */ + free(yylval.sval); + yylval.sval = NULL; } enum_val ';' { diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 9d625e9..f3258d6 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1282,6 +1282,7 @@ static int test_strings(void) HDfree(dt_str); goto out; } + HDfree(dt_str); /* Length of the character buffer is smaller then needed */ str_len = 21; |