summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2017-06-20 06:56:52 -0400
committerThomas Markwalder <tmark@isc.org>2017-06-20 06:56:52 -0400
commit8c785e79414e524d7998c3a8f382620b8b5c40f8 (patch)
treeafc776e1921062569ff46952aec71379ea45d587 /client
parentca22af89996483efd820de0084c964fc336ee7c1 (diff)
downloadisc-dhcp-8c785e79414e524d7998c3a8f382620b8b5c40f8.tar.gz
[master] Added allocation failure error messages to two locations
Merges in rt41185.
Diffstat (limited to 'client')
-rw-r--r--client/dhclient.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/dhclient.c b/client/dhclient.c
index 40fd876a..56586f2b 100644
--- a/client/dhclient.c
+++ b/client/dhclient.c
@@ -4224,8 +4224,11 @@ void client_envadd (struct client_state *client,
val = dmalloc (strlen (prefix) + strlen (name) + 1 /* = */ +
len + sizeof *val, MDL);
- if (!val)
+ if (!val) {
+ log_error ("client_envadd: cannot allocate space for variable");
return;
+ }
+
s = val -> string;
strcpy (s, prefix);
strcat (s, name);
@@ -4235,8 +4238,10 @@ void client_envadd (struct client_state *client,
va_start (list, fmt);
vsnprintf (s, len + 1, fmt, list);
va_end (list);
- } else
+ } else {
strcpy (s, spbuf);
+ }
+
val -> next = client -> env;
client -> env = val;
client -> envc++;