summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/yacc/skeleton.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c
index 9329ccf9e93..a6e17d47a22 100644
--- a/usr.bin/yacc/skeleton.c
+++ b/usr.bin/yacc/skeleton.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: skeleton.c,v 1.22 2003/11/25 20:00:15 espie Exp $ */
+/* $OpenBSD: skeleton.c,v 1.23 2004/03/12 13:39:50 henning Exp $ */
/* $NetBSD: skeleton.c,v 1.10 1996/03/25 00:36:18 mrg Exp $ */
/*
@@ -63,7 +63,7 @@ char *banner[] =
"#if __GNUC__ >= 2",
" __attribute__ ((unused))",
"#endif /* __GNUC__ >= 2 */",
- " = \"$OpenBSD: skeleton.c,v 1.22 2003/11/25 20:00:15 espie Exp $\";",
+ " = \"$OpenBSD: skeleton.c,v 1.23 2004/03/12 13:39:50 henning Exp $\";",
"#endif",
"#include <stdlib.h>",
"#define YYBYACC 1",
@@ -397,8 +397,22 @@ char *trailer[] =
"yyoverflow:",
" yyerror(\"yacc stack overflow\");",
"yyabort:",
+ " if (yyss)",
+ " free(yyss);",
+ " if (yyvs)",
+ " free(yyvs);",
+ " yyss = yyssp = NULL;",
+ " yyvs = yyvsp = NULL;",
+ " yystacksize = 0;",
" return (1);",
"yyaccept:",
+ " if (yyss)",
+ " free(yyss);",
+ " if (yyvs)",
+ " free(yyvs);",
+ " yyss = yyssp = NULL;",
+ " yyvs = yyvsp = NULL;",
+ " yystacksize = 0;",
" return (0);",
"}",
0