diff options
author | 2004-05-04 11:34:01 +0000 | |
---|---|---|
committer | 2004-05-04 11:34:01 +0000 | |
commit | 07a2bb26dae9d8f5c9539e37e818f60262363697 (patch) | |
tree | e10fe31def90770ae0d5f3f62dfe0eaaf15f698c | |
parent | sync (diff) | |
download | wireguard-openbsd-07a2bb26dae9d8f5c9539e37e818f60262363697.tar.xz wireguard-openbsd-07a2bb26dae9d8f5c9539e37e818f60262363697.zip |
Correctly plug the memory leak and fix a error message.
-rw-r--r-- | usr.sbin/bgpd/parse.y | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 7f9ad037a5d..c5a0e5ac1c7 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.99 2004/04/30 17:34:05 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.100 2004/05/04 11:34:01 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -835,15 +835,17 @@ filter_match : /* empty */ { bzero(&$$, sizeof($$)); } free($2); YYERROR; } - free($2); if (i == 0 || i == USHRT_MAX) { - yyerror("Bad community as number"); + free($2); + yyerror("Bad community AS number"); YYERROR; } $$.community.as = i; if ((i = getcommunity(p)) == COMMUNITY_ERROR) { + free($2); YYERROR; } + free($2); $$.community.type = i; } ; |