]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1638. [bug] "ixfr-from-differences" could generate a REQUIRE
authorMark Andrews <marka@isc.org>
Fri, 14 May 2004 05:08:00 +0000 (05:08 +0000)
committerMark Andrews <marka@isc.org>
Fri, 14 May 2004 05:08:00 +0000 (05:08 +0000)
                        failure if the journal open failed. [RT #11347]

CHANGES
lib/dns/journal.c

diff --git a/CHANGES b/CHANGES
index 733317ea83b22a535c2de7ea32e8d019b359c8ca..7854b60a1a59b1447062656bc9b5a3619bdd9f76 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,8 @@
 1639.  [func]          Initial dlv system test.
 
-1638.  [placeholder]   rt113347
-
+1638.  [bug]           "ixfr-from-differences" could generate a REQUIRE
+                       failure if the journal open failed. [RT #11347]
+                       
 1637.  [bug]           Node reference leak on error in addnoqname().
 
 1636.  [bug]           The dump done callback could get ISC_R_SUCCESS even if
index 95c8bc577a058564442f23a216065c2704ace5ae..5930af4fe02156fea21bf81db22f06c0178d4900 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: journal.c,v 1.87 2004/05/11 22:20:13 marka Exp $ */
+/* $Id: journal.c,v 1.88 2004/05/14 05:08:00 marka Exp $ */
 
 #include <config.h>
 
@@ -1822,10 +1822,16 @@ dns_db_diff(isc_mem_t *mctx,
        dns_fixedname_init(&fixname[0]);
        dns_fixedname_init(&fixname[1]);
 
-       CHECK(dns_journal_open(mctx, journal_filename, ISC_TRUE, &journal));
+       result = dns_journal_open(mctx, journal_filename, ISC_TRUE, &journal);
+       if (result != ISC_R_SUCCESS)
+               return (result);
 
-       CHECK(dns_db_createiterator(db[0], ISC_FALSE, &dbit[0]));
-       CHECK(dns_db_createiterator(db[1], ISC_FALSE, &dbit[1]));
+       result = dns_db_createiterator(db[0], ISC_FALSE, &dbit[0]);
+       if (result != ISC_R_SUCCESS)
+               goto cleanup_journal;
+       result = dns_db_createiterator(db[1], ISC_FALSE, &dbit[1]);
+       if (result != ISC_R_SUCCESS)
+               goto cleanup_interator0;
 
        itresult[0] = dns_dbiterator_first(dbit[0]);
        itresult[1] = dns_dbiterator_first(dbit[1]);
@@ -1898,8 +1904,10 @@ dns_db_diff(isc_mem_t *mctx,
 
  failure:
        dns_diff_clear(&resultdiff);
-       dns_dbiterator_destroy(&dbit[0]);
        dns_dbiterator_destroy(&dbit[1]);
+ cleanup_interator0:
+       dns_dbiterator_destroy(&dbit[0]);
+ cleanup_journal:
        dns_journal_destroy(&journal);
        return (result);
 }