diff options
author | Thomas Markwalder <tmark@isc.org> | 2015-09-23 15:24:32 -0400 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2015-09-23 15:24:32 -0400 |
commit | 88c3ff5d09699150cc1ebae2fd861fbf2684d4a1 (patch) | |
tree | 6145f371ed841cd19ab84f548e5291bd47dc3595 /common | |
parent | f10cbbface262ba51394b2c8ccf402addf7bd6b1 (diff) | |
download | isc-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.c | 7 |
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); |