]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace isc_mem_put()+isc_mem_detach() with isc_mem_putanddetach() in contrib/
authorOndřej Surý <ondrej@isc.org>
Sat, 8 Feb 2020 10:46:25 +0000 (02:46 -0800)
committerOndřej Surý <ondrej@isc.org>
Sat, 8 Feb 2020 11:12:09 +0000 (03:12 -0800)
contrib/dlz/drivers/dlz_bdb_driver.c
contrib/dlz/drivers/dlz_bdbhpt_driver.c
contrib/dlz/drivers/dlz_filesystem_driver.c
contrib/dlz/drivers/dlz_stub_driver.c
contrib/dlz/drivers/sdlz_helper.c
contrib/dlz/modules/mysqldyn/dlz_mysqldyn_mod.c

index bde080ab16d59478539a3aedf264db0a37aa3bb5..ddfefd6d8f6bfef8ca75596296dbe25d44118eb6 100644 (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));
        }
 }
 
index 4d3d93560759e8ca46f09457c58fc45a8aa09b99..03a3a3d0dba54a99ffdbffeb559d5569140512b6 100644 (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));
        }
 }
 
index a3fe98dd67e64004ee8226449ae5c80bdb8cefed..c7383d5b47eafd408aefe44c09a0cade2cb65b19 100644 (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 = {
index 02d856db90a15a36b5e84eceaff3ec637da01da3..6d16f2a318b9e156a63a660f46edd3910a0b9f91 100644 (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 = {
index 6eb66292457f071098e4e6b9ed755ac62ae4c4b7..c8708c52e8a54e62dfc106251fdcb7940c8600e6 100644 (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 *
index f8e47f8f24c15bb78e0f2cc6dcfa1d62f4b7bae3..6ce095e941860424b6a7de56f6b3bca04da7546b 100644 (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 */