2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

Replace isc_mem_put()+isc_mem_detach() with isc_mem_putanddetach() in contrib/

This commit is contained in:
Ondřej Surý 2020-02-08 02:46:25 -08:00
parent 341840c026
commit de92c24b56
6 changed files with 7 additions and 14 deletions

View File

@ -373,8 +373,7 @@ bdb_cleanup(bdb_instance_t *db) {
/* save mctx for later */
mctx = db->mctx;
/* return, and detach the memory */
isc_mem_put(mctx, db, sizeof(bdb_instance_t));
isc_mem_detach(&mctx);
isc_mem_putanddetach(&mctx, db, sizeof(bdb_instance_t));
}
}

View File

@ -463,8 +463,7 @@ bdbhpt_cleanup(bdbhpt_instance_t *db) {
/* save mctx for later */
mctx = db->mctx;
/* return, and detach the memory */
isc_mem_put(mctx, db, sizeof(bdbhpt_instance_t));
isc_mem_detach(&mctx);
isc_mem_putanddetach(&mctx, db, sizeof(bdbhpt_instance_t));
}
}

View File

@ -936,10 +936,7 @@ fs_destroy(void *driverarg, void *dbdata)
mctx = cd->mctx;
/* free config data memory */
isc_mem_put(mctx, cd, sizeof(config_data_t));
/* detach memory from context */
isc_mem_detach(&mctx);
isc_mem_putanddetach(&mctx, cd, sizeof(config_data_t));
}
static dns_sdlzmethods_t dlz_fs_methods = {

View File

@ -255,8 +255,7 @@ stub_dlz_destroy(void *driverarg, void *dbdata)
isc_mem_free(named_g_mctx, cd->myname);
isc_mem_free(named_g_mctx, cd->myip);
mctx = cd->mctx;
isc_mem_put(mctx, cd, sizeof(config_data_t));
isc_mem_detach(&mctx);
isc_mem_putanddetach(&mctx, cd, sizeof(config_data_t));
}
static dns_sdlzmethods_t dlz_stub_methods = {

View File

@ -450,8 +450,7 @@ sdlzh_destroy_sqldbinstance(dbinstance_t *dbi)
(void) isc_mutex_destroy(&dbi->instance_lock);
/* return, and detach the memory */
isc_mem_put(mctx, dbi, sizeof(dbinstance_t));
isc_mem_detach(&mctx);
isc_mem_putanddetach(&mctx, dbi, sizeof(dbinstance_t));
}
char *

View File

@ -669,7 +669,7 @@ make_notify(const char *zone, int *packetlen) {
/* Question */
packet[12] = '.';
memcpy(&packet[13], zone, strlen(zone));
memmove(&packet[13], zone, strlen(zone));
packet[13 + strlen(zone)] = 0;
/* Make the question into labels */
@ -755,7 +755,7 @@ notify(mysql_data_t *state, const char *zone, int sn) {
if (h == NULL)
continue;
memcpy(&addr.sin_addr, h->h_addr, h->h_length);
memmove(&addr.sin_addr, h->h_addr, h->h_length);
addrp = &addr.sin_addr;
/* Get the address for the nameserver into a string */