]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup in journal_open() correctly (#41129)
author李昶 <lichang.eric@gmail.com>
Thu, 19 Nov 2015 05:50:22 +0000 (11:20 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 19 Nov 2015 05:50:59 +0000 (11:20 +0530)
lib/dns/journal.c

index 9ce21e4f26b2aaaf08c768f3c50b0fa6892c5deb..be03d9fc2007fe97a45db0a6e2acbd4833f0214d 100644 (file)
@@ -682,11 +682,12 @@ journal_open(isc_mem_t *mctx, const char *filename, isc_boolean_t writable,
 
  failure:
        j->magic = 0;
-       if (j->index != NULL) {
-               isc_mem_put(j->mctx, j->index, j->header.index_size *
+       if (j->rawindex != NULL)
+               isc_mem_put(j->mctx, j->rawindex, j->header.index_size *
                            sizeof(journal_rawpos_t));
-               j->index = NULL;
-       }
+       if (j->index != NULL)
+               isc_mem_put(j->mctx, j->index, j->header.index_size *
+                           sizeof(journal_pos_t));
        if (j->filename != NULL)
                isc_mem_free(j->mctx, j->filename);
        if (j->fp != NULL)