summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlestes <wlestes>2001-06-18 12:49:03 +0000
committerwlestes <wlestes>2001-06-18 12:49:03 +0000
commit858fd709443b72a6ee3696d6408195f262f02e8d (patch)
tree9a11335e9a4d6bb01e95522c70c3355b40c81313
parent3c21ffd395e6e82d9ccaad015bf8d70cf46b5eff (diff)
downloadflex-858fd709443b72a6ee3696d6408195f262f02e8d.tar.gz
patch memory leak as per millaway
-rw-r--r--flex.skl12
1 files changed, 12 insertions, 0 deletions
diff --git a/flex.skl b/flex.skl
index 4b74db2..d7efb98 100644
--- a/flex.skl
+++ b/flex.skl
@@ -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;