diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2007-02-26 00:49:54 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2007-02-26 00:49:54 +0000 |
commit | 30b6141fd8c6b0364c83e7462b7e70d38d7a22a3 (patch) | |
tree | 4f72542bbf5f71e49c645abf3637ed0d988da557 | |
parent | 0cf44257271552bc31c97d36a142c101f9918d73 (diff) |
don't leak memory, from dhclient; ok krw@
-rw-r--r-- | usr.sbin/dhcpd/parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/parse.c b/usr.sbin/dhcpd/parse.c index 1121aac62da..13398243f10 100644 --- a/usr.sbin/dhcpd/parse.c +++ b/usr.sbin/dhcpd/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.10 2006/11/22 21:35:56 stevesk Exp $ */ +/* $OpenBSD: parse.c,v 1.11 2007/02/26 00:49:53 stevesk Exp $ */ /* Common parser code for dhcpd and dhclient. */ @@ -128,8 +128,10 @@ parse_string(FILE *cfile) error("no memory for string %s.", val); strlcpy(s, val, strlen(val) + 1); - if (!parse_semi(cfile)) + if (!parse_semi(cfile)) { + free(s); return (NULL); + } return (s); } |