diff options
author | 1998-11-24 01:21:29 +0000 | |
---|---|---|
committer | 1998-11-24 01:21:29 +0000 | |
commit | 95135d26bbd839888fe742c7afdf3045e5308343 (patch) | |
tree | c62e13834184bf35172dc4957b3e53ddcc2433e6 | |
parent | typo; abs (diff) | |
download | wireguard-openbsd-95135d26bbd839888fe742c7afdf3045e5308343.tar.xz wireguard-openbsd-95135d26bbd839888fe742c7afdf3045e5308343.zip |
fix memory leaks; itohy@netbsd
-rw-r--r-- | usr.bin/lex/gen.c | 5 | ||||
-rw-r--r-- | usr.bin/yacc/reader.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/lex/gen.c b/usr.bin/lex/gen.c index a776d5a8a7a..a1ae45e8c69 100644 --- a/usr.bin/lex/gen.c +++ b/usr.bin/lex/gen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gen.c,v 1.3 1996/07/13 22:22:01 millert Exp $ */ +/* $OpenBSD: gen.c,v 1.4 1998/11/24 01:21:36 deraadt Exp $ */ /* gen - actual generation (writing) of flex scanners */ @@ -28,7 +28,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -/* $Header: /home/cvs/src/usr.bin/lex/gen.c,v 1.3 1996/07/13 22:22:01 millert Exp $ */ +/* $Header: /home/cvs/src/usr.bin/lex/gen.c,v 1.4 1998/11/24 01:21:36 deraadt Exp $ */ #include "flexdef.h" @@ -1025,6 +1025,7 @@ void gentabs() } dataend(); + free(acc_array); } diff --git a/usr.bin/yacc/reader.c b/usr.bin/yacc/reader.c index 84e8fe6fce1..18fdff56b78 100644 --- a/usr.bin/yacc/reader.c +++ b/usr.bin/yacc/reader.c @@ -1,4 +1,4 @@ -/* $OpenBSD: reader.c,v 1.5 1996/04/21 23:45:19 deraadt Exp $ */ +/* $OpenBSD: reader.c,v 1.6 1998/11/24 01:21:29 deraadt Exp $ */ /* $NetBSD: reader.c,v 1.5 1996/03/19 03:21:43 jtc Exp $ */ @@ -847,6 +847,7 @@ get_tag() if (c == EOF) unexpected_EOF(); if (c != '>') illegal_tag(t_lineno, t_line, t_cptr); + FREE(t_line); ++cptr; for (i = 0; i < ntags; ++i) @@ -869,7 +870,6 @@ get_tag() strcpy(s, cache); tag_table[ntags] = s; ++ntags; - FREE(t_line); return (s); } @@ -1403,6 +1403,7 @@ loop: case ';': if (depth > 0) goto loop; fprintf(f, "\nbreak;\n"); + FREE(a_line); return; case '{': @@ -1412,6 +1413,7 @@ loop: case '}': if (--depth > 0) goto loop; fprintf(f, "\nbreak;\n"); + FREE(a_line); return; case '\'': |