diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-10-09 21:35:30 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-10-09 21:35:30 (GMT) |
commit | cfe6d9a8da37bd7af03d976fce6ac77994bb79b3 (patch) | |
tree | 68acc074051c8c0dae20b6fb482a1de4d5dcaf8c /hl/src/H5LTparse.y | |
parent | 3444e46ea08a415a08b1005167c77a44896d4591 (diff) | |
download | hdf5-cfe6d9a8da37bd7af03d976fce6ac77994bb79b3.zip hdf5-cfe6d9a8da37bd7af03d976fce6ac77994bb79b3.tar.gz hdf5-cfe6d9a8da37bd7af03d976fce6ac77994bb79b3.tar.bz2 |
[svn-r28019] fix mem leaks.
Diffstat (limited to 'hl/src/H5LTparse.y')
-rw-r--r-- | hl/src/H5LTparse.y | 13 |
1 files changed, 11 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 ';' { |