summaryrefslogtreecommitdiff
path: root/flex.skl
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2001-06-18 12:49:03 +0000
committerWill Estes <wlestes@users.sourceforge.net>2001-06-18 12:49:03 +0000
commit9aa410c0878c8f4926bd274ab97ec3bf588f79c8 (patch)
tree64562ce371e468fb920ccb5883cc4332f228984f /flex.skl
parentab8a2d2107d7b93c486abe90a401475e25e50901 (diff)
patch memory leak as per millaway
Diffstat (limited to 'flex.skl')
-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;