diff options
Diffstat (limited to 'src/cparse/cparse_lex.l')
-rw-r--r-- | src/cparse/cparse_lex.l | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cparse/cparse_lex.l b/src/cparse/cparse_lex.l index 61c016f..49f8d47 100644 --- a/src/cparse/cparse_lex.l +++ b/src/cparse/cparse_lex.l @@ -61,6 +61,18 @@ set_ret_str() str_ptr = str_buf; } +static void +free_str() +{ + free(str_buf); + free(out_buf); + node_deactivated = 0; + str_buf = NULL; + out_buf = NULL; + str_ptr = NULL; + str_buf_len = 0; +} + %} %% @@ -98,6 +110,7 @@ set_ret_str() ++tmp; } cparse_lval.str = strdup(tmp); + free_str(); BEGIN(INITIAL); return COMMENT; } @@ -170,6 +183,7 @@ set_ret_str() <sQStr>\" { set_ret_str(); cparse_lval.str = strdup(out_buf); + free_str(); BEGIN(sValue); return VALUE; } |