diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-08 17:19:21 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-08 17:19:21 +0000 |
commit | 4b8b88b5a7b9df5519e35a784f38a9eadfab03bd (patch) | |
tree | 73289e8e552314ad53aa613c50a6099cfb3a43f3 | |
parent | 0454c732bcf67fa6113e2400dc76fed6feb1872e (diff) |
Correct strsep() usage to free() correct string. Spotted by and
original diff from Michael McConville via tech@. Thanks!
ok millert@ beck@ guenther@ jca@
-rw-r--r-- | sbin/dhclient/dhclient.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 8e0eb31ab06..b324e9d81db 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.363 2015/09/05 07:41:16 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.364 2015/09/08 17:19:20 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -1923,13 +1923,13 @@ res_hnok(const char *name) int res_hnok_list(const char *names) { - char *hn, *inputstring; + char *dupnames, *hn, *inputstring; int count; if (strlen(names) >= 1024) return (0); - inputstring = strdup(names); + dupnames = inputstring = strdup(names); if (inputstring == NULL) error("Cannot copy domain name list"); @@ -1944,7 +1944,7 @@ res_hnok_list(const char *names) break; } - free(inputstring); + free(dupnames); return (count > 0 && count < 7 && hn == NULL); } |