summaryrefslogtreecommitdiff
path: root/common
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 /common
parentca22af89996483efd820de0084c964fc336ee7c1 (diff)
downloadisc-dhcp-8c785e79414e524d7998c3a8f382620b8b5c40f8.tar.gz
[master] Added allocation failure error messages to two locations
Merges in rt41185.
Diffstat (limited to 'common')
-rw-r--r--common/discover.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/discover.c b/common/discover.c
index 6824ec4b..57fd1b66 100644
--- a/common/discover.c
+++ b/common/discover.c
@@ -3,7 +3,7 @@
Find and identify the network interfaces. */
/*
- * Copyright (c) 2004-2016 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2017 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* Permission to use, copy, modify, and distribute this software for any
@@ -1491,8 +1491,11 @@ void interface_stash (struct interface_info *tptr)
delta = tptr -> index - interface_max + 10;
vec = dmalloc ((interface_max + delta) *
sizeof (struct interface_info *), MDL);
- if (!vec)
+ if (!vec) {
+ log_error ("interface_stash: allocation failed ");
return;
+ }
+
memset (&vec [interface_max], 0,
(sizeof (struct interface_info *)) * delta);
interface_max += delta;
@@ -1502,8 +1505,10 @@ void interface_stash (struct interface_info *tptr)
sizeof (struct interface_info *)));
dfree (interface_vector, MDL);
}
+
interface_vector = vec;
}
+
interface_reference (&interface_vector [tptr -> index], tptr, MDL);
if (tptr -> index >= interface_count)
interface_count = tptr -> index + 1;