summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwlestes <wlestes>2007-04-23 12:37:38 +0000
committerwlestes <wlestes>2007-04-23 12:37:38 +0000
commit8f0d5ad151833985bf78d4bbddc2ccd9672f5de5 (patch)
treea8f041d156172a06d8a6971e60b287384869d40b
parent555f52604a188512eef8ea23c9fb94bed5ea8321 (diff)
downloadflex-8f0d5ad151833985bf78d4bbddc2ccd9672f5de5.tar.gz
fix c++ memory leak (from Manoj Srivastava from Debian patchset)
-rw-r--r--flex.skl7
1 files changed, 7 insertions, 0 deletions
diff --git a/flex.skl b/flex.skl
index bc455e6..f581683 100644
--- a/flex.skl
+++ b/flex.skl
@@ -2842,6 +2842,12 @@ m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],
YY_G(yy_start_stack) = NULL;
]])
+%if-c++-only
+ delete [] YY_G(yy_state_buf);
+ yyfree(YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );
+%endif
+
+%if-c-only
m4_ifdef( [[M4_YY_USES_REJECT]],
[[
yyfree ( YY_G(yy_state_buf) M4_YY_CALL_LAST_ARG);
@@ -2939,6 +2945,7 @@ static int yytbl_read8 (void *v, struct yytbl_reader * rd)
}
rd->bread += sizeof(flex_uint8_t);
return 0;
+%endif
}
static int yytbl_read16 (void *v, struct yytbl_reader * rd)