From dc0ecf08dbea81b6ebfcd3a18b52aa974472b1ba Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 2 Jan 2008 04:26:26 +0000 Subject: [PATCH] 2284. [bug] Memory leak in UPDATE prerequisite processing. [RT #17377] --- CHANGES | 3 +++ bin/named/update.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 3cad1cb6ff..ae5945b4a8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2284. [bug] Memory leak in UPDATE prerequisite processing. + [RT #17377] + 2283. [bug] TSIG keys were not attaching to the memory context. TSIG keys should use the rings memory context rather than the clients memory diff --git a/bin/named/update.c b/bin/named/update.c index 4d60dcf350..e1525a2840 100644 --- a/bin/named/update.c +++ b/bin/named/update.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: update.c,v 1.137 2007/08/28 00:05:06 marka Exp $ */ +/* $Id: update.c,v 1.138 2008/01/02 04:26:26 marka Exp $ */ #include @@ -857,10 +857,14 @@ temp_check(isc_mem_t *mctx, dns_diff_t *temp, dns_db_t *db, /* A new unique name begins here. */ node = NULL; result = dns_db_findnode(db, name, ISC_FALSE, &node); - if (result == ISC_R_NOTFOUND) + if (result == ISC_R_NOTFOUND) { + dns_diff_clear(&trash); return (DNS_R_NXRRSET); - if (result != ISC_R_SUCCESS) + } + if (result != ISC_R_SUCCESS) { + dns_diff_clear(&trash); return (result); + } /* A new unique type begins here. */ while (t != NULL && dns_name_equal(&t->name, name)) { @@ -888,6 +892,7 @@ temp_check(isc_mem_t *mctx, dns_diff_t *temp, dns_db_t *db, &rdataset, NULL); if (result != ISC_R_SUCCESS) { dns_db_detachnode(db, &node); + dns_diff_clear(&trash); return (DNS_R_NXRRSET); }