diff options
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 460e659f8e6..7f9ad037a5d 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.98 2004/04/30 05:47:50 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.99 2004/04/30 17:34:05 deraadt Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -826,19 +826,24 @@ filter_match : /* empty */ { bzero(&$$, sizeof($$)); } bzero(&$$, sizeof($$)); if ((p = strchr($2, ':')) == NULL) { + free($2); yyerror("Bad community syntax"); YYERROR; } *p++ = 0; - if ((i = getcommunity($2)) == COMMUNITY_ERROR) + if ((i = getcommunity($2)) == COMMUNITY_ERROR) { + free($2); YYERROR; + } + free($2); if (i == 0 || i == USHRT_MAX) { yyerror("Bad community as number"); YYERROR; } $$.community.as = i; - if ((i = getcommunity(p)) == COMMUNITY_ERROR) + if ((i = getcommunity(p)) == COMMUNITY_ERROR) { YYERROR; + } $$.community.type = i; } ; |