summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2021-03-31 20:52:10 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2021-03-31 20:52:10 +0000
commitfbf7ed7b799dd68a38bc3bf3e844d8105a82a0b1 (patch)
tree4446c2dfc03589dc97caeceb855c11274a64ca90 /sbin/dhclient
parent2fcb955cd00994d046113aecc47bf942e505b159 (diff)
Add two missing checks for strdup() returning NULL.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 97fe48c0174..919c6e64eb3 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.716 2021/03/31 15:32:11 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.717 2021/03/31 20:52:09 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2370,10 +2370,14 @@ apply_defaults(struct client_lease *lease)
if (config->filename != NULL) {
free(newlease->filename);
newlease->filename = strdup(config->filename);
+ if (newlease->filename == NULL)
+ fatal("strdup(config->filename)");
}
if (config->server_name != NULL) {
free(newlease->server_name);
newlease->server_name = strdup(config->server_name);
+ if (newlease->server_name == NULL)
+ fatal("strdup(config->server_name)");
}
if (config->address.s_addr != INADDR_ANY)
newlease->address.s_addr = config->address.s_addr;