diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-06-09 18:26:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-06-09 18:26:36 +0000 |
commit | 8df5fc371b2dba96217fc28ba5760bab2b988c8e (patch) | |
tree | fbed2ee636d26993bf44bc89a989b957646b3637 /usr.sbin | |
parent | 761cc24ed85627530de3168d202ec4afb8d45269 (diff) |
do not leak memory on failure in refid production; ok ckuethe henning
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ntpd/parse.y | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ntpd/parse.y b/usr.sbin/ntpd/parse.y index 252ee7e87e1..d61d6eee125 100644 --- a/usr.sbin/ntpd/parse.y +++ b/usr.sbin/ntpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.43 2008/06/09 16:37:35 ckuethe Exp $ */ +/* $OpenBSD: parse.y,v 1.44 2008/06/09 18:26:35 deraadt Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -261,11 +261,11 @@ correction : CORRECTION NUMBER { ; refid : REFID STRING { - size_t l; - l = strlen($2); + size_t l = strlen($2); + if (l < 1 || l > 4) { - yyerror("refid must be a string of 1 to 4 " - "characters"); + yyerror("refid must be 1 to 4 characters"); + free($2); YYERROR; } opts.refstr = $2; |