summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2004-05-04 11:34:02 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2004-05-04 11:34:02 +0000
commit2daf03fc192c6120be9db3e0262049bb69a67354 (patch)
tree092bb4db940d85b72ebb0a46958baf6a24f3c8a4 /usr.sbin/bgpd/parse.y
parente2eb580f6e27cf52a6cf8cb8e2211a753d7fb083 (diff)
Correctly plug the memory leak and fix a error message.
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y8
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;
}
;