summaryrefslogtreecommitdiff
path: root/common/ctrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/ctrace.c')
-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);