diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-02-12 01:20:33 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-02-12 01:20:33 -0500 |
commit | 018eeacaa4059df74e2745fcdadc2ad85afec985 (patch) | |
tree | f9887bc21ec91f7b6d2fa786a76d7c1d36e26ce7 | |
parent | 0b07431aa3128e9cb903b933148f20353953c592 (diff) | |
download | dimension-018eeacaa4059df74e2745fcdadc2ad85afec985.tar.xz |
Don't leak a file handle on parse failures from within includes.
-rw-r--r-- | dimension/tokenize.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/dimension/tokenize.c b/dimension/tokenize.c index e872e0c..33512ae 100644 --- a/dimension/tokenize.c +++ b/dimension/tokenize.c @@ -866,6 +866,11 @@ dmnsn_yylex_cleanup(void *yyscanner) { dmnsn_token_buffer *tbuffer = dmnsn_yyget_extra(yyscanner); while (tbuffer) { + if (tbuffer->type == DMNSN_T_INCLUDE) { + dmnsn_yy_pop_buffer(yyscanner); + fclose(tbuffer->ptr); + } + dmnsn_token_buffer *prev = tbuffer->prev; dmnsn_delete_token_buffer(tbuffer); tbuffer = prev; |