]> granicus.if.org Git - flex/commitdiff
fix c++ memory leak (from Manoj Srivastava from Debian patchset)
authorWill Estes <wlestes@users.sourceforge.net>
Mon, 23 Apr 2007 12:37:38 +0000 (12:37 +0000)
committerWill Estes <wlestes@users.sourceforge.net>
Mon, 23 Apr 2007 12:37:38 +0000 (12:37 +0000)
flex.skl

index bc455e68088d2a0ae2b3cfc69be61a4bd2c4c74e..f581683a7367d0efae70fa961f51f5936a0c777c 100644 (file)
--- 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)