Merge topic 'cmListFileLexer-fix-leak-on-error'

ad3d5c5 cmListFileLexer: Fix leak on error before EOF
This commit is contained in:
Brad King 2013-10-07 15:43:59 -04:00 committed by CMake Topic Stage
commit 55af4ba26f
2 changed files with 2 additions and 0 deletions

View File

@ -2271,6 +2271,7 @@ static void cmListFileLexerInit(cmListFileLexer* lexer)
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
static void cmListFileLexerDestroy(cmListFileLexer* lexer) static void cmListFileLexerDestroy(cmListFileLexer* lexer)
{ {
cmListFileLexerSetToken(lexer, 0, 0);
if(lexer->file || lexer->string_buffer) if(lexer->file || lexer->string_buffer)
{ {
cmListFileLexer_yylex_destroy(lexer->scanner); cmListFileLexer_yylex_destroy(lexer->scanner);

View File

@ -292,6 +292,7 @@ static void cmListFileLexerInit(cmListFileLexer* lexer)
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
static void cmListFileLexerDestroy(cmListFileLexer* lexer) static void cmListFileLexerDestroy(cmListFileLexer* lexer)
{ {
cmListFileLexerSetToken(lexer, 0, 0);
if(lexer->file || lexer->string_buffer) if(lexer->file || lexer->string_buffer)
{ {
cmListFileLexer_yylex_destroy(lexer->scanner); cmListFileLexer_yylex_destroy(lexer->scanner);