2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

4128. [bug] Address issues raised by Coverity 7.6. [RT #39537]

This commit is contained in:
Mark Andrews
2015-05-28 13:17:07 +10:00
parent 52a487f71a
commit e53e202ef3
16 changed files with 61 additions and 57 deletions

View File

@@ -240,8 +240,8 @@ dns_dlzcreate(isc_mem_t *mctx, const char *dlzname, const char *drivername,
void
dns_dlzdestroy(dns_dlzdb_t **dbp) {
isc_mem_t *mctx;
dns_dlzdestroy_t destroy;
dns_dlzdb_t *db;
/* Write debugging message to log */
isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
@@ -253,23 +253,19 @@ dns_dlzdestroy(dns_dlzdb_t **dbp) {
*/
REQUIRE(dbp != NULL && DNS_DLZ_VALID(*dbp));
if ((*dbp)->ssutable != NULL) {
dns_ssutable_detach(&(*dbp)->ssutable);
}
db = *dbp;
*dbp = NULL;
if (db->ssutable != NULL)
dns_ssutable_detach(&db->ssutable);
/* call the drivers destroy method */
if ((*dbp) != NULL) {
mctx = (*dbp)->mctx;
if ((*dbp)->dlzname != NULL)
isc_mem_free(mctx, (*dbp)->dlzname);
destroy = (*dbp)->implementation->methods->destroy;
(*destroy)((*dbp)->implementation->driverarg,(*dbp)->dbdata);
/* return memory */
isc_mem_put(mctx, (*dbp), sizeof(dns_dlzdb_t));
isc_mem_detach(&mctx);
}
*dbp = NULL;
if (db->dlzname != NULL)
isc_mem_free(db->mctx, db->dlzname);
destroy = db->implementation->methods->destroy;
(*destroy)(db->implementation->driverarg, db->dbdata);
/* return memory and detach */
isc_mem_putanddetach(&db->mctx, db, sizeof(dns_dlzdb_t));
}
/*%