summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2015-09-23 15:24:32 -0400
committerThomas Markwalder <tmark@isc.org>2015-09-23 15:24:32 -0400
commit88c3ff5d09699150cc1ebae2fd861fbf2684d4a1 (patch)
tree6145f371ed841cd19ab84f548e5291bd47dc3595 /common
parentf10cbbface262ba51394b2c8ccf402addf7bd6b1 (diff)
downloadisc-dhcp-88c3ff5d09699150cc1ebae2fd861fbf2684d4a1.tar.gz
[master] Corrected several potential null references identified by static analysis
Merges branch rt40754
Diffstat (limited to 'common')
-rw-r--r--common/ctrace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/ctrace.c b/common/ctrace.c
index 578ea5e7..63520242 100644
--- a/common/ctrace.c
+++ b/common/ctrace.c
@@ -84,6 +84,13 @@ void trace_interface_input (trace_type_t *ttype, unsigned len, char *buf)
*/
ip->address_count = ip->address_max = 1;
ip->addresses = dmalloc(sizeof(*ip->addresses), MDL);
+ if (!ip->addresses) {
+ dfree(ip->ifp, MDL);
+ ip->ifp = NULL;
+ interface_dereference (&ip, MDL);
+ status = ISC_R_NOMEMORY;
+ goto foo;
+ }
memcpy(ip->addresses, &tipkt->primary_address, sizeof(*ip->addresses));
memcpy (ip -> name, tipkt -> name, sizeof ip -> name);
ip -> index = ntohl (tipkt -> index);