diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-08 13:34:39 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-01-08 13:34:39 +0000 |
commit | 405b2cea000c3c2e09d4f486aff444c6fca41e8a (patch) | |
tree | 2e496f2606e7bd510350304b265620a8535b0ccc /sbin | |
parent | 3f47757c067bb9174573d8d2b87814e4707302f5 (diff) |
Don't leak strings.
ok miod@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/dhclient/parse.c b/sbin/dhclient/parse.c index 9311f52a8b5..78ce155a102 100644 --- a/sbin/dhclient/parse.c +++ b/sbin/dhclient/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.17 2006/11/22 21:35:56 stevesk Exp $ */ +/* $OpenBSD: parse.c,v 1.18 2007/01/08 13:34:38 krw 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); } |