summaryrefslogtreecommitdiff
path: root/lib/dns/message.c
diff options
context:
space:
mode:
authorErwin Lansing <erwin@FreeBSD.org>2013-08-14 11:10:02 +0000
committerErwin Lansing <erwin@FreeBSD.org>2013-08-14 11:10:02 +0000
commit98ec2cd1facbb6a0e284fd0bacab33fbafb76fb8 (patch)
tree2158e1c09a984412fbfaaf073f515cd4e8f1ea60 /lib/dns/message.c
parent2f7409b5f669dbe3c0a8e58d8f526cb6ac4f64e1 (diff)
Notes
Diffstat (limited to 'lib/dns/message.c')
-rw-r--r--lib/dns/message.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/dns/message.c b/lib/dns/message.c
index d36edbae3b14..53efc5a1beb5 100644
--- a/lib/dns/message.c
+++ b/lib/dns/message.c
@@ -732,7 +732,9 @@ dns_message_create(isc_mem_t *mctx, unsigned int intent, dns_message_t **msgp)
for (i = 0; i < DNS_SECTION_MAX; i++)
ISC_LIST_INIT(m->sections[i]);
- m->mctx = mctx;
+
+ m->mctx = NULL;
+ isc_mem_attach(mctx, &m->mctx);
ISC_LIST_INIT(m->scratchpad);
ISC_LIST_INIT(m->cleanup);
@@ -786,7 +788,7 @@ dns_message_create(isc_mem_t *mctx, unsigned int intent, dns_message_t **msgp)
if (m->rdspool != NULL)
isc_mempool_destroy(&m->rdspool);
m->magic = 0;
- isc_mem_put(mctx, m, sizeof(dns_message_t));
+ isc_mem_putanddetach(&mctx, m, sizeof(dns_message_t));
return (ISC_R_NOMEMORY);
}
@@ -815,7 +817,7 @@ dns_message_destroy(dns_message_t **msgp) {
isc_mempool_destroy(&msg->namepool);
isc_mempool_destroy(&msg->rdspool);
msg->magic = 0;
- isc_mem_put(msg->mctx, msg, sizeof(dns_message_t));
+ isc_mem_putanddetach(&msg->mctx, msg, sizeof(dns_message_t));
}
static isc_result_t