summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-01-08 13:34:39 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-01-08 13:34:39 +0000
commit405b2cea000c3c2e09d4f486aff444c6fca41e8a (patch)
tree2e496f2606e7bd510350304b265620a8535b0ccc /sbin
parent3f47757c067bb9174573d8d2b87814e4707302f5 (diff)
Don't leak strings.
ok miod@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/parse.c6
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);
}