Cleanup in journal_open() correctly (#41129)

This commit is contained in:
李昶
2015-11-19 11:20:22 +05:30
committed by Mukund Sivaraman
parent 7bc21557f3
commit 65f6e2f909

View 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)