summaryrefslogtreecommitdiff
path: root/sbin/dhclient/clparse.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2017-10-12 13:28:50 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2017-10-12 13:28:50 +0000
commit1fffd23abc4c7f3f106ae0f3367844db71f30bdf (patch)
tree0a7369e42f792b8f718e9fc77a1878dcf059fc5f /sbin/dhclient/clparse.c
parent2688db8de70a544047c6eb158bd59a4e9c5b8921 (diff)
Stop leaks of SSID strings. Whitespace fix.
Diffstat (limited to 'sbin/dhclient/clparse.c')
-rw-r--r--sbin/dhclient/clparse.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index 2bf99581d32..5869b8ee76e 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clparse.c,v 1.135 2017/10/12 13:10:13 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.136 2017/10/12 13:28:49 krw Exp $ */
/* Parser for dhclient config and lease files. */
@@ -568,8 +568,8 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease,
if (rslt != 0) {
if (lease->is_static == 0)
parse_warn("wrong interface name.");
- skip_to_semi(cfile);
- return;
+ skip_to_semi(cfile);
+ return;
}
break;
case TOK_FIXED_ADDR:
@@ -596,12 +596,14 @@ parse_client_lease_declaration(FILE *cfile, struct client_lease *lease,
if (parse_string(cfile, &len, &val) == 0)
return;
if (len > sizeof(lease->ssid)) {
+ free(val);
parse_warn("ssid > 32 bytes");
skip_to_semi(cfile);
return;
}
memset(lease->ssid, 0, sizeof(lease->ssid));
memcpy(lease->ssid, val, len);
+ free(val);
lease->ssid_len = len;
break;
case TOK_RENEW: