summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-11-05 14:28:30 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-11-05 14:28:30 +0000
commit77f793209538fb47d4c6ca5f8936e416a5d47483 (patch)
tree1c1907589f4d731ecc001b51524ef8412a099999 /usr.sbin/ntpd
parent8b5ed39a7f8dac71c1eb09c99c6e824b529982c6 (diff)
memleaks in error pathes, patrick latifi, Thanks!
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r--usr.sbin/ntpd/parse.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y
index a4aa8365ea9..7d4288a2f77 100644
--- a/usr.sbin/ntpd/parse.y
+++ b/usr.sbin/ntpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.21 2004/09/15 00:23:08 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.22 2004/11/05 14:28:29 henning Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -117,6 +117,7 @@ conf_main : LISTEN ON address {
h->ss.ss_family != AF_INET6) {
yyerror("IPv4 or IPv6 address "
"or hostname expected");
+ free(h);
free($2->name);
free($2);
YYERROR;
@@ -151,6 +152,8 @@ conf_main : LISTEN ON address {
h->ss.ss_family != AF_INET6) {
yyerror("IPv4 or IPv6 address "
"or hostname expected");
+ free(h);
+ free(p);
free($2->name);
free($2);
YYERROR;
@@ -178,6 +181,7 @@ address : STRING {
yyerror("could not parse address spec \"%s\"",
$1);
free($1);
+ free($$);
YYERROR;
}
$$->name = $1;