diff options
author | wlestes <wlestes> | 2001-06-18 12:49:03 +0000 |
---|---|---|
committer | wlestes <wlestes> | 2001-06-18 12:49:03 +0000 |
commit | 858fd709443b72a6ee3696d6408195f262f02e8d (patch) | |
tree | 9a11335e9a4d6bb01e95522c70c3355b40c81313 | |
parent | 3c21ffd395e6e82d9ccaad015bf8d70cf46b5eff (diff) | |
download | flex-858fd709443b72a6ee3696d6408195f262f02e8d.tar.gz |
patch memory leak as per millaway
-rw-r--r-- | flex.skl | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1959,6 +1959,18 @@ int yylex_destroy( yy_globals ) { if( yy_globals ) { + + /* Destroy the current (main) buffer. */ + yy_delete_buffer( YY_G(yy_current_buffer) YY_CALL_LAST_ARG ); + YY_G(yy_current_buffer) = NULL; + + /* Destroy the start condition stack. */ + if( YY_G(yy_start_stack) ) { + yy_flex_free( YY_G(yy_start_stack) ); + YY_G(yy_start_stack) = NULL; + } + + /* Destroy the main struct. */ yy_flex_free ( yy_globals YY_CALL_LAST_ARG ); } return 0; |