mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-03 13:59:27 -04:00
Refactor dns_name_dup() usage using the semantic patch
This commit is contained in:
parent
21902d0ac7
commit
edd97cddc1
28 changed files with 85 additions and 327 deletions
|
|
@ -800,10 +800,7 @@ named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
|
|||
dns_rootname, 0, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
result = dns_name_dup(dns_fixedname_name(&fname), mctx,
|
||||
keys[i - 1]);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
dns_name_dup(dns_fixedname_name(&fname), mctx, keys[i - 1]);
|
||||
}
|
||||
if (pushed != 0) {
|
||||
pushed--;
|
||||
|
|
|
|||
|
|
@ -7403,7 +7403,7 @@ configure_session_key(const cfg_obj_t **maps, named_server_t *server,
|
|||
server->session_keyname = isc_mem_get(mctx,
|
||||
sizeof(dns_name_t));
|
||||
dns_name_init(server->session_keyname, NULL);
|
||||
CHECK(dns_name_dup(keyname, mctx, server->session_keyname));
|
||||
dns_name_dup(keyname, mctx, server->session_keyname);
|
||||
|
||||
server->session_keyfile = isc_mem_strdup(mctx, keyfile);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
|||
RETERR(dns_name_fromtext(name, &b, dns_rootname, 0, NULL));
|
||||
tctx->domain = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(tctx->domain, NULL);
|
||||
RETERR(dns_name_dup(name, mctx, tctx->domain));
|
||||
dns_name_dup(name, mctx, tctx->domain);
|
||||
}
|
||||
|
||||
obj = NULL;
|
||||
|
|
@ -114,4 +114,3 @@ named_tkeyctx_fromconfig(const cfg_obj_t *options, isc_mem_t *mctx,
|
|||
dns_tkeyctx_destroy(&tctx);
|
||||
return (result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -244,8 +244,7 @@ lookup(const char *target) {
|
|||
result = dns_name_fromtext(&name, &t, dns_rootname, 0, &namebuf);
|
||||
check_result(result, "dns_name_fromtext %s", target);
|
||||
|
||||
result = dns_name_dup(&name, mctx, &client->name);
|
||||
check_result(result, "dns_name_dup %s", target);
|
||||
dns_name_dup(&name, mctx, &client->name);
|
||||
|
||||
options = 0;
|
||||
options |= DNS_ADBFIND_INET;
|
||||
|
|
|
|||
|
|
@ -310,11 +310,8 @@ dns_acl_merge(dns_acl_t *dest, dns_acl_t *source, bool pos)
|
|||
/* Duplicate key name. */
|
||||
if (source->elements[i].type == dns_aclelementtype_keyname) {
|
||||
dns_name_init(&dest->elements[nelem+i].keyname, NULL);
|
||||
result = dns_name_dup(&source->elements[i].keyname,
|
||||
dest->mctx,
|
||||
&dest->elements[nelem+i].keyname);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return result;
|
||||
dns_name_dup(&source->elements[i].keyname, dest->mctx,
|
||||
&dest->elements[nelem + i].keyname);
|
||||
}
|
||||
|
||||
#if defined(HAVE_GEOIP2)
|
||||
|
|
|
|||
|
|
@ -1402,10 +1402,8 @@ set_target(dns_adb_t *adb, const dns_name_t *name, const dns_name_t *fname,
|
|||
result = dns_rdata_tostruct(&rdata, &cname, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
result = dns_name_dup(&cname.cname, adb->mctx, target);
|
||||
dns_name_dup(&cname.cname, adb->mctx, target);
|
||||
dns_rdata_freestruct(&cname);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
} else {
|
||||
dns_rdata_dname_t dname;
|
||||
|
||||
|
|
@ -1433,9 +1431,7 @@ set_target(dns_adb_t *adb, const dns_name_t *name, const dns_name_t *fname,
|
|||
dns_rdata_freestruct(&dname);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
result = dns_name_dup(new_target, adb->mctx, target);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_name_dup(new_target, adb->mctx, target);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
|
|
@ -1669,10 +1665,7 @@ new_adbname(dns_adb_t *adb, const dns_name_t *dnsname) {
|
|||
return (NULL);
|
||||
|
||||
dns_name_init(&name->name, NULL);
|
||||
if (dns_name_dup(dnsname, adb->mctx, &name->name) != ISC_R_SUCCESS) {
|
||||
isc_mempool_put(adb->nmp, name);
|
||||
return (NULL);
|
||||
}
|
||||
dns_name_dup(dnsname, adb->mctx, &name->name);
|
||||
dns_name_init(&name->target, NULL);
|
||||
name->magic = DNS_ADBNAME_MAGIC;
|
||||
name->adb = adb;
|
||||
|
|
@ -1775,10 +1768,7 @@ new_adblameinfo(dns_adb_t *adb, const dns_name_t *qname,
|
|||
return (NULL);
|
||||
|
||||
dns_name_init(&li->qname, NULL);
|
||||
if (dns_name_dup(qname, adb->mctx, &li->qname) != ISC_R_SUCCESS) {
|
||||
isc_mempool_put(adb->limp, li);
|
||||
return (NULL);
|
||||
}
|
||||
dns_name_dup(qname, adb->mctx, &li->qname);
|
||||
li->magic = DNS_ADBLAMEINFO_MAGIC;
|
||||
li->lame_timer = 0;
|
||||
li->qtype = qtype;
|
||||
|
|
|
|||
|
|
@ -128,12 +128,8 @@ copy_ptr_targets(dns_byaddr_t *byaddr, dns_rdataset_t *rdataset) {
|
|||
return (result);
|
||||
name = isc_mem_get(byaddr->mctx, sizeof(*name));
|
||||
dns_name_init(name, NULL);
|
||||
result = dns_name_dup(&ptr.ptr, byaddr->mctx, name);
|
||||
dns_name_dup(&ptr.ptr, byaddr->mctx, name);
|
||||
dns_rdata_freestruct(&ptr);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(byaddr->mctx, name, sizeof(*name));
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
ISC_LIST_APPEND(byaddr->event->names, name, link);
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(rdataset);
|
||||
|
|
|
|||
|
|
@ -200,7 +200,6 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
|
|||
dns_catz_entry_t **nentryp)
|
||||
{
|
||||
dns_catz_entry_t *nentry;
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(mctx != NULL);
|
||||
REQUIRE(nentryp != NULL && *nentryp == NULL);
|
||||
|
|
@ -209,9 +208,7 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
|
|||
|
||||
dns_name_init(&nentry->name, NULL);
|
||||
if (domain != NULL) {
|
||||
result = dns_name_dup(domain, mctx, &nentry->name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
dns_name_dup(domain, mctx, &nentry->name);
|
||||
}
|
||||
|
||||
dns_catz_options_init(&nentry->opts);
|
||||
|
|
@ -219,10 +216,6 @@ dns_catz_entry_new(isc_mem_t *mctx, const dns_name_t *domain,
|
|||
nentry->magic = DNS_CATZ_ENTRY_MAGIC;
|
||||
*nentryp = nentry;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
cleanup:
|
||||
isc_mem_put(mctx, nentry, sizeof(dns_catz_entry_t));
|
||||
return (result);
|
||||
}
|
||||
|
||||
dns_name_t *
|
||||
|
|
@ -650,10 +643,7 @@ dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **zonep,
|
|||
memset(new_zone, 0, sizeof(*new_zone));
|
||||
|
||||
dns_name_init(&new_zone->name, NULL);
|
||||
|
||||
result = dns_name_dup(name, catzs->mctx, &new_zone->name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_newzone;
|
||||
dns_name_dup(name, catzs->mctx, &new_zone->name);
|
||||
|
||||
result = isc_ht_init(&new_zone->entries, catzs->mctx, 4);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
@ -688,7 +678,6 @@ dns_catz_new_zone(dns_catz_zones_t *catzs, dns_catz_zone_t **zonep,
|
|||
isc_ht_destroy(&new_zone->entries);
|
||||
cleanup_name:
|
||||
dns_name_free(&new_zone->name, catzs->mctx);
|
||||
cleanup_newzone:
|
||||
isc_mem_put(catzs->mctx, new_zone, sizeof(*new_zone));
|
||||
|
||||
return (result);
|
||||
|
|
@ -960,12 +949,8 @@ catz_process_zones_entry(dns_catz_zone_t *zone, dns_rdataset_t *value,
|
|||
dns_rdata_freestruct(&ptr);
|
||||
return (ISC_R_FAILURE);
|
||||
} else {
|
||||
result = dns_name_dup(&ptr.ptr, zone->catzs->mctx,
|
||||
&entry->name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_rdata_freestruct(&ptr);
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(&ptr.ptr, zone->catzs->mctx,
|
||||
&entry->name);
|
||||
}
|
||||
} else {
|
||||
result = dns_catz_entry_new(zone->catzs->mctx, &ptr.ptr,
|
||||
|
|
@ -1166,15 +1151,7 @@ catz_process_masters(dns_catz_zone_t *zone, dns_ipkeylist_t *ipkl,
|
|||
ipkl->labels[i] = isc_mem_get(mctx,
|
||||
sizeof(dns_name_t));
|
||||
dns_name_init(ipkl->labels[i], NULL);
|
||||
result = dns_name_dup(name, mctx, ipkl->labels[i]);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (keyname != NULL) {
|
||||
dns_name_free(keyname, mctx);
|
||||
isc_mem_put(mctx, keyname,
|
||||
sizeof(dns_name_t));
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(name, mctx, ipkl->labels[i]);
|
||||
|
||||
if (value->type == dns_rdatatype_txt)
|
||||
ipkl->keys[i] = keyname;
|
||||
|
|
|
|||
|
|
@ -897,7 +897,7 @@ client_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
|
|||
ansname = isc_mem_get(mctx, sizeof(*ansname));
|
||||
dns_name_init(ansname, NULL);
|
||||
|
||||
(void)dns_name_dup(aname, mctx, ansname);
|
||||
dns_name_dup(aname, mctx, ansname);
|
||||
}
|
||||
|
||||
switch (result) {
|
||||
|
|
|
|||
|
|
@ -1450,7 +1450,6 @@ get_key_struct(const dns_name_t *name, unsigned int alg,
|
|||
dns_ttl_t ttl, isc_mem_t *mctx)
|
||||
{
|
||||
dst_key_t *key;
|
||||
isc_result_t result;
|
||||
int i;
|
||||
|
||||
key = isc_mem_get(mctx, sizeof(dst_key_t));
|
||||
|
|
@ -1460,12 +1459,7 @@ get_key_struct(const dns_name_t *name, unsigned int alg,
|
|||
key->key_name = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
|
||||
dns_name_init(key->key_name, NULL);
|
||||
result = dns_name_dup(name, mctx, key->key_name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, key->key_name, sizeof(dns_name_t));
|
||||
isc_mem_put(mctx, key, sizeof(dst_key_t));
|
||||
return (NULL);
|
||||
}
|
||||
dns_name_dup(name, mctx, key->key_name);
|
||||
|
||||
isc_refcount_init(&key->refs, 1);
|
||||
isc_mem_attach(mctx, &key->mctx);
|
||||
|
|
|
|||
|
|
@ -315,7 +315,6 @@ findnode(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
dns_ecdb_t *ecdb = (dns_ecdb_t *)db;
|
||||
isc_mem_t *mctx;
|
||||
dns_ecdbnode_t *node;
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(VALID_ECDB(ecdb));
|
||||
REQUIRE(nodep != NULL && *nodep == NULL);
|
||||
|
|
@ -333,12 +332,7 @@ findnode(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
isc_mutex_init(&node->lock);
|
||||
|
||||
dns_name_init(&node->name, NULL);
|
||||
result = dns_name_dup(name, mctx, &node->name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mutex_destroy(&node->lock);
|
||||
isc_mem_put(mctx, node, sizeof(*node));
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(name, mctx, &node->name);
|
||||
|
||||
isc_refcount_init(&node->references, 1);
|
||||
ISC_LIST_INIT(node->rdatasets);
|
||||
|
|
|
|||
|
|
@ -104,10 +104,7 @@ dns_ipkeylist_copy(isc_mem_t *mctx, const dns_ipkeylist_t *src,
|
|||
dst->keys[i] = isc_mem_get(mctx,
|
||||
sizeof(dns_name_t));
|
||||
dns_name_init(dst->keys[i], NULL);
|
||||
result = dns_name_dup(src->keys[i], mctx,
|
||||
dst->keys[i]);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_keys;
|
||||
dns_name_dup(src->keys[i], mctx, dst->keys[i]);
|
||||
} else {
|
||||
dst->keys[i] = NULL;
|
||||
}
|
||||
|
|
@ -120,10 +117,8 @@ dns_ipkeylist_copy(isc_mem_t *mctx, const dns_ipkeylist_t *src,
|
|||
dst->labels[i] = isc_mem_get(mctx,
|
||||
sizeof(dns_name_t));
|
||||
dns_name_init(dst->labels[i], NULL);
|
||||
result = dns_name_dup(src->labels[i], mctx,
|
||||
dst->labels[i]);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_labels;
|
||||
dns_name_dup(src->labels[i], mctx,
|
||||
dst->labels[i]);
|
||||
} else {
|
||||
dst->labels[i] = NULL;
|
||||
}
|
||||
|
|
@ -132,7 +127,6 @@ dns_ipkeylist_copy(isc_mem_t *mctx, const dns_ipkeylist_t *src,
|
|||
dst->count = src->count;
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
cleanup_labels:
|
||||
do {
|
||||
if (dst->labels[i] != NULL) {
|
||||
if (dns_name_dynamic(dst->labels[i]))
|
||||
|
|
@ -142,7 +136,6 @@ dns_ipkeylist_copy(isc_mem_t *mctx, const dns_ipkeylist_t *src,
|
|||
}
|
||||
} while (i-- > 0);
|
||||
|
||||
cleanup_keys:
|
||||
do {
|
||||
if (dst->keys[i] != NULL) {
|
||||
if (dns_name_dynamic(dst->keys[i]))
|
||||
|
|
|
|||
|
|
@ -99,14 +99,10 @@ build_event(dns_lookup_t *lookup) {
|
|||
dns_name_t *name = NULL;
|
||||
dns_rdataset_t *rdataset = NULL;
|
||||
dns_rdataset_t *sigrdataset = NULL;
|
||||
isc_result_t result;
|
||||
|
||||
name = isc_mem_get(lookup->mctx, sizeof(dns_name_t));
|
||||
dns_name_init(name, NULL);
|
||||
result = dns_name_dup(dns_fixedname_name(&lookup->name),
|
||||
lookup->mctx, name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto fail;
|
||||
dns_name_dup(dns_fixedname_name(&lookup->name), lookup->mctx, name);
|
||||
|
||||
if (dns_rdataset_isassociated(&lookup->rdataset)) {
|
||||
rdataset = isc_mem_get(lookup->mctx, sizeof(dns_rdataset_t));
|
||||
|
|
@ -126,19 +122,6 @@ build_event(dns_lookup_t *lookup) {
|
|||
lookup->event->sigrdataset = sigrdataset;
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
fail:
|
||||
if (name != NULL) {
|
||||
if (dns_name_dynamic(name))
|
||||
dns_name_free(name, lookup->mctx);
|
||||
isc_mem_put(lookup->mctx, name, sizeof(dns_name_t));
|
||||
}
|
||||
if (rdataset != NULL) {
|
||||
if (dns_rdataset_isassociated(rdataset))
|
||||
dns_rdataset_disassociate(rdataset);
|
||||
isc_mem_put(lookup->mctx, rdataset, sizeof(dns_rdataset_t));
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
|
|
|
|||
|
|
@ -651,11 +651,7 @@ dns_peer_setkeybycharp(dns_peer_t *peer, const char *keyval) {
|
|||
name = isc_mem_get(peer->mem, sizeof(dns_name_t));
|
||||
|
||||
dns_name_init(name, NULL);
|
||||
result = dns_name_dup(dns_fixedname_name(&fname), peer->mem, name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(peer->mem, name, sizeof(dns_name_t));
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(dns_fixedname_name(&fname), peer->mem, name);
|
||||
|
||||
result = dns_peer_setkey(peer, &name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
|
|
|
|||
|
|
@ -6337,9 +6337,7 @@ addnoqname(dns_rbtdb_t *rbtdb, rdatasetheader_t *newheader,
|
|||
noqname->neg = NULL;
|
||||
noqname->negsig = NULL;
|
||||
noqname->type = neg.type;
|
||||
result = dns_name_dup(&name, mctx, &noqname->name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
dns_name_dup(&name, mctx, &noqname->name);
|
||||
result = dns_rdataslab_fromrdataset(&neg, mctx, &r, 0);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
@ -6384,9 +6382,7 @@ addclosest(dns_rbtdb_t *rbtdb, rdatasetheader_t *newheader,
|
|||
closest->neg = NULL;
|
||||
closest->negsig = NULL;
|
||||
closest->type = neg.type;
|
||||
result = dns_name_dup(&name, mctx, &closest->name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
dns_name_dup(&name, mctx, &closest->name);
|
||||
result = dns_rdataslab_fromrdataset(&neg, mctx, &r, 0);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
|
|
|
|||
|
|
@ -374,9 +374,11 @@ locator_pton(const char *src, unsigned char *dst) {
|
|||
static inline isc_result_t
|
||||
name_duporclone(const dns_name_t *source, isc_mem_t *mctx, dns_name_t *target) {
|
||||
|
||||
if (mctx != NULL)
|
||||
return (dns_name_dup(source, mctx, target));
|
||||
dns_name_clone(source, target);
|
||||
if (mctx != NULL) {
|
||||
dns_name_dup(source, mctx, target);
|
||||
} else {
|
||||
dns_name_clone(source, target);
|
||||
}
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3569,10 +3569,8 @@ fctx_getaddresses(fetchctx_t *fctx, bool badcache) {
|
|||
fcount_decr(fctx);
|
||||
dns_name_free(&fctx->domain, fctx->mctx);
|
||||
dns_name_init(&fctx->domain, NULL);
|
||||
result = dns_name_dup(domain, fctx->mctx,
|
||||
&fctx->domain);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
dns_name_dup(domain, fctx->mctx,
|
||||
&fctx->domain);
|
||||
result = fcount_incr(fctx, true);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
|
@ -4243,11 +4241,7 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
|
|||
fcount_decr(fctx);
|
||||
dns_name_free(&fctx->domain, fctx->mctx);
|
||||
dns_name_init(&fctx->domain, NULL);
|
||||
result = dns_name_dup(fname, fctx->mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fctx_done(fctx, result, __LINE__);
|
||||
goto cleanup;
|
||||
}
|
||||
dns_name_dup(fname, fctx->mctx, &fctx->domain);
|
||||
|
||||
result = fcount_incr(fctx, false);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -4257,11 +4251,7 @@ resume_qmin(isc_task_t *task, isc_event_t *event) {
|
|||
|
||||
dns_name_free(&fctx->qmindcname, fctx->mctx);
|
||||
dns_name_init(&fctx->qmindcname, NULL);
|
||||
result = dns_name_dup(dcname, fctx->mctx, &fctx->qmindcname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fctx_done(fctx, result, __LINE__);
|
||||
goto cleanup;
|
||||
}
|
||||
dns_name_dup(dcname, fctx->mctx, &fctx->qmindcname);
|
||||
fctx->ns_ttl = fctx->nameservers.ttl;
|
||||
fctx->ns_ttl_ok = true;
|
||||
|
||||
|
|
@ -4769,13 +4759,9 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
|||
|
||||
FCTXTRACE("create");
|
||||
dns_name_init(&fctx->name, NULL);
|
||||
result = dns_name_dup(name, mctx, &fctx->name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_info;
|
||||
dns_name_dup(name, mctx, &fctx->name);
|
||||
dns_name_init(&fctx->qminname, NULL);
|
||||
result = dns_name_dup(name, mctx, &fctx->qminname);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_qminname;
|
||||
dns_name_dup(name, mctx, &fctx->qminname);
|
||||
dns_name_init(&fctx->domain, NULL);
|
||||
dns_rdataset_init(&fctx->nameservers);
|
||||
|
||||
|
|
@ -4900,42 +4886,24 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
|||
goto cleanup_nameservers;
|
||||
}
|
||||
|
||||
result = dns_name_dup(fname, mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_nameservers;
|
||||
}
|
||||
result = dns_name_dup(dcname, mctx, &fctx->qmindcname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_domain;
|
||||
}
|
||||
dns_name_dup(fname, mctx, &fctx->domain);
|
||||
dns_name_dup(dcname, mctx, &fctx->qmindcname);
|
||||
fctx->ns_ttl = fctx->nameservers.ttl;
|
||||
fctx->ns_ttl_ok = true;
|
||||
} else {
|
||||
/*
|
||||
* We're in forward-only mode. Set the query domain.
|
||||
*/
|
||||
result = dns_name_dup(fname, mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_name;
|
||||
}
|
||||
result = dns_name_dup(fname, mctx, &fctx->qmindcname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_domain;
|
||||
}
|
||||
dns_name_dup(fname, mctx, &fctx->domain);
|
||||
dns_name_dup(fname, mctx, &fctx->qmindcname);
|
||||
/*
|
||||
* Disable query minimization
|
||||
*/
|
||||
options &= ~DNS_FETCHOPT_QMINIMIZE;
|
||||
}
|
||||
} else {
|
||||
result = dns_name_dup(domain, mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_name;
|
||||
}
|
||||
result = dns_name_dup(domain, mctx, &fctx->qmindcname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_domain;
|
||||
}
|
||||
dns_name_dup(domain, mctx, &fctx->domain);
|
||||
dns_name_dup(domain, mctx, &fctx->qmindcname);
|
||||
dns_rdataset_clone(nameservers, &fctx->nameservers);
|
||||
fctx->ns_ttl = fctx->nameservers.ttl;
|
||||
fctx->ns_ttl_ok = true;
|
||||
|
|
@ -5070,14 +5038,8 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
|
|||
cleanup_nameservers:
|
||||
if (dns_rdataset_isassociated(&fctx->nameservers))
|
||||
dns_rdataset_disassociate(&fctx->nameservers);
|
||||
|
||||
cleanup_name:
|
||||
dns_name_free(&fctx->name, mctx);
|
||||
|
||||
cleanup_qminname:
|
||||
dns_name_free(&fctx->qminname, mctx);
|
||||
|
||||
cleanup_info:
|
||||
isc_mem_free(mctx, fctx->info);
|
||||
isc_counter_detach(&fctx->qc);
|
||||
|
||||
|
|
@ -7108,11 +7070,7 @@ resume_dslookup(isc_task_t *task, isc_event_t *event) {
|
|||
fcount_decr(fctx);
|
||||
dns_name_free(&fctx->domain, fctx->mctx);
|
||||
dns_name_init(&fctx->domain, NULL);
|
||||
result = dns_name_dup(&fctx->nsname, fctx->mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
|
||||
goto cleanup;
|
||||
}
|
||||
dns_name_dup(&fctx->nsname, fctx->mctx, &fctx->domain);
|
||||
result = fcount_incr(fctx, true);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
|
||||
|
|
@ -9209,21 +9167,12 @@ rctx_referral(respctx_t *rctx) {
|
|||
}
|
||||
|
||||
dns_name_init(&fctx->domain, NULL);
|
||||
result = dns_name_dup(rctx->ns_name, fctx->mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
rctx->result = result;
|
||||
return (ISC_R_COMPLETE);
|
||||
}
|
||||
dns_name_dup(rctx->ns_name, fctx->mctx, &fctx->domain);
|
||||
|
||||
if ((fctx->options & DNS_FETCHOPT_QMINIMIZE) != 0) {
|
||||
dns_name_free(&fctx->qmindcname, fctx->mctx);
|
||||
dns_name_init(&fctx->qmindcname, NULL);
|
||||
result = dns_name_dup(rctx->ns_name, fctx->mctx,
|
||||
&fctx->qmindcname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
rctx->result = result;
|
||||
return (ISC_R_COMPLETE);
|
||||
}
|
||||
dns_name_dup(rctx->ns_name, fctx->mctx, &fctx->qmindcname);
|
||||
|
||||
result= fctx_minimize_qname(fctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -9370,18 +9319,10 @@ rctx_nextserver(respctx_t *rctx, dns_adbaddrinfo_t *addrinfo,
|
|||
|
||||
dns_name_free(&fctx->domain, fctx->mctx);
|
||||
dns_name_init(&fctx->domain, NULL);
|
||||
result = dns_name_dup(fname, fctx->mctx, &fctx->domain);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
|
||||
return;
|
||||
}
|
||||
dns_name_dup(fname, fctx->mctx, &fctx->domain);
|
||||
dns_name_free(&fctx->qmindcname, fctx->mctx);
|
||||
dns_name_init(&fctx->qmindcname, NULL);
|
||||
result = dns_name_dup(dcname, fctx->mctx, &fctx->qmindcname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
|
||||
return;
|
||||
}
|
||||
dns_name_dup(dcname, fctx->mctx, &fctx->qmindcname);
|
||||
|
||||
result = fcount_incr(fctx, true);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
@ -10441,7 +10382,7 @@ log_fetch(const dns_name_t *name, dns_rdatatype_t type) {
|
|||
|
||||
static isc_result_t
|
||||
fctx_minimize_qname(fetchctx_t *fctx) {
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
unsigned int dlabels, nlabels;
|
||||
|
||||
REQUIRE(VALID_FCTX(fctx));
|
||||
|
|
@ -10501,20 +10442,20 @@ fctx_minimize_qname(fetchctx_t *fctx) {
|
|||
result = dns_name_concatenate(&underscore_name,
|
||||
name, tname, &dbuf);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
result = dns_name_dup(tname, fctx->mctx,
|
||||
&fctx->qminname);
|
||||
dns_name_dup(tname, fctx->mctx,
|
||||
&fctx->qminname);
|
||||
}
|
||||
fctx->qmintype = dns_rdatatype_a;
|
||||
} else {
|
||||
result = dns_name_dup(dns_fixedname_name(&fname),
|
||||
fctx->mctx, &fctx->qminname);
|
||||
dns_name_dup(dns_fixedname_name(&fname),
|
||||
fctx->mctx, &fctx->qminname);
|
||||
fctx->qmintype = dns_rdatatype_ns;
|
||||
}
|
||||
fctx->minimized = true;
|
||||
} else {
|
||||
/* Minimization is done, we'll ask for whole qname */
|
||||
fctx->qmintype = fctx->type;
|
||||
result = dns_name_dup(&fctx->name, fctx->mctx, &fctx->qminname);
|
||||
dns_name_dup(&fctx->name, fctx->mctx, &fctx->qminname);
|
||||
fctx->minimized = false;
|
||||
}
|
||||
|
||||
|
|
@ -10858,7 +10799,6 @@ isc_result_t
|
|||
dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt,
|
||||
const dns_name_t *name, in_port_t port) {
|
||||
alternate_t *a;
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(VALID_RESOLVER(resolver));
|
||||
REQUIRE(!resolver->frozen);
|
||||
|
|
@ -10872,11 +10812,7 @@ dns_resolver_addalternate(dns_resolver_t *resolver, const isc_sockaddr_t *alt,
|
|||
a->isaddress = false;
|
||||
a->_u._n.port = port;
|
||||
dns_name_init(&a->_u._n.name, NULL);
|
||||
result = dns_name_dup(name, resolver->mctx, &a->_u._n.name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(resolver->mctx, a, sizeof(*a));
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(name, resolver->mctx, &a->_u._n.name);
|
||||
}
|
||||
ISC_LINK_INIT(a, link);
|
||||
ISC_LIST_APPEND(resolver->alternates, a, link);
|
||||
|
|
|
|||
|
|
@ -444,12 +444,7 @@ getnode(dns_sdballnodes_t *allnodes, const char *name, dns_sdbnode_t **nodep) {
|
|||
return (result);
|
||||
sdbnode->name = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(sdbnode->name, NULL);
|
||||
result = dns_name_dup(newname, mctx, sdbnode->name);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, sdbnode->name, sizeof(dns_name_t));
|
||||
destroynode(sdbnode);
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(newname, mctx, sdbnode->name);
|
||||
ISC_LIST_PREPEND(allnodes->nodelist, sdbnode, link);
|
||||
if (allnodes->origin == NULL &&
|
||||
dns_name_equal(newname, &sdb->common.origin))
|
||||
|
|
|
|||
|
|
@ -663,8 +663,7 @@ getnodedata(dns_db_t *db, const dns_name_t *name, bool create,
|
|||
node->name = isc_mem_get(sdlz->common.mctx,
|
||||
sizeof(dns_name_t));
|
||||
dns_name_init(node->name, NULL);
|
||||
result = dns_name_dup(name, sdlz->common.mctx, node->name);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
dns_name_dup(name, sdlz->common.mctx, node->name);
|
||||
}
|
||||
|
||||
*nodep = node;
|
||||
|
|
@ -1950,8 +1949,7 @@ dns_sdlz_putnamedrr(dns_sdlzallnodes_t *allnodes, const char *name,
|
|||
return (result);
|
||||
sdlznode->name = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(sdlznode->name, NULL);
|
||||
result = dns_name_dup(newname, mctx, sdlznode->name);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
dns_name_dup(newname, mctx, sdlznode->name);
|
||||
ISC_LIST_PREPEND(allnodes->nodelist, sdlznode, link);
|
||||
if (allnodes->origin == NULL &&
|
||||
dns_name_equal(newname, &sdlz->common.origin))
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@ dns_ssutable_addrule(dns_ssutable_t *table, bool grant,
|
|||
{
|
||||
dns_ssurule_t *rule;
|
||||
isc_mem_t *mctx;
|
||||
isc_result_t result;
|
||||
|
||||
REQUIRE(VALID_SSUTABLE(table));
|
||||
REQUIRE(dns_name_isabsolute(identity));
|
||||
|
|
@ -157,15 +156,11 @@ dns_ssutable_addrule(dns_ssutable_t *table, bool grant,
|
|||
|
||||
rule->identity = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(rule->identity, NULL);
|
||||
result = dns_name_dup(identity, mctx, rule->identity);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto failure;
|
||||
dns_name_dup(identity, mctx, rule->identity);
|
||||
|
||||
rule->name = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(rule->name, NULL);
|
||||
result = dns_name_dup(name, mctx, rule->name);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto failure;
|
||||
dns_name_dup(name, mctx, rule->name);
|
||||
|
||||
rule->matchtype = matchtype;
|
||||
|
||||
|
|
@ -181,24 +176,6 @@ dns_ssutable_addrule(dns_ssutable_t *table, bool grant,
|
|||
ISC_LIST_INITANDAPPEND(table->rules, rule, link);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
failure:
|
||||
if (rule->identity != NULL) {
|
||||
if (dns_name_dynamic(rule->identity))
|
||||
dns_name_free(rule->identity, mctx);
|
||||
isc_mem_put(mctx, rule->identity, sizeof(dns_name_t));
|
||||
}
|
||||
if (rule->name != NULL) {
|
||||
if (dns_name_dynamic(rule->name))
|
||||
dns_name_free(rule->name, mctx);
|
||||
isc_mem_put(mctx, rule->name, sizeof(dns_name_t));
|
||||
}
|
||||
if (rule->types != NULL)
|
||||
isc_mem_put(mctx, rule->types,
|
||||
ntypes * sizeof(dns_rdatatype_t));
|
||||
isc_mem_put(mctx, rule, sizeof(dns_ssurule_t));
|
||||
|
||||
return (result);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ add_rdata_to_list(dns_message_t *msg, dns_name_t *name, dns_rdata_t *rdata,
|
|||
|
||||
RETERR(dns_message_gettempname(msg, &newname));
|
||||
dns_name_init(newname, NULL);
|
||||
RETERR(dns_name_dup(name, msg->mctx, newname));
|
||||
dns_name_dup(name, msg->mctx, newname);
|
||||
|
||||
RETERR(dns_message_gettemprdatalist(msg, &newlist));
|
||||
newlist->rdclass = newrdata->rdclass;
|
||||
|
|
|
|||
|
|
@ -266,9 +266,7 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm,
|
|||
tkey = isc_mem_get(mctx, sizeof(dns_tsigkey_t));
|
||||
|
||||
dns_name_init(&tkey->name, NULL);
|
||||
ret = dns_name_dup(name, mctx, &tkey->name);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_key;
|
||||
dns_name_dup(name, mctx, &tkey->name);
|
||||
(void)dns_name_downcase(&tkey->name, &tkey->name, NULL);
|
||||
|
||||
/* Check against known algorithm names */
|
||||
|
|
@ -291,11 +289,7 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm,
|
|||
}
|
||||
tmpname = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(tmpname, NULL);
|
||||
ret = dns_name_dup(algorithm, mctx, tmpname);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, tmpname, sizeof(dns_name_t));
|
||||
goto cleanup_name;
|
||||
}
|
||||
dns_name_dup(algorithm, mctx, tmpname);
|
||||
(void)dns_name_downcase(tmpname, tmpname, NULL);
|
||||
tkey->algorithm = tmpname;
|
||||
}
|
||||
|
|
@ -303,11 +297,7 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm,
|
|||
if (creator != NULL) {
|
||||
tkey->creator = isc_mem_get(mctx, sizeof(dns_name_t));
|
||||
dns_name_init(tkey->creator, NULL);
|
||||
ret = dns_name_dup(creator, mctx, tkey->creator);
|
||||
if (ret != ISC_R_SUCCESS) {
|
||||
isc_mem_put(mctx, tkey->creator, sizeof(dns_name_t));
|
||||
goto cleanup_algorithm;
|
||||
}
|
||||
dns_name_dup(creator, mctx, tkey->creator);
|
||||
} else
|
||||
tkey->creator = NULL;
|
||||
|
||||
|
|
@ -369,7 +359,6 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm,
|
|||
dns_name_free(tkey->creator, mctx);
|
||||
isc_mem_put(mctx, tkey->creator, sizeof(dns_name_t));
|
||||
}
|
||||
cleanup_algorithm:
|
||||
if (dns__tsig_algallocated(tkey->algorithm)) {
|
||||
dns_name_t *tmpname;
|
||||
DE_CONST(tkey->algorithm, tmpname);
|
||||
|
|
@ -379,7 +368,6 @@ dns_tsigkey_createfromkey(const dns_name_t *name, const dns_name_t *algorithm,
|
|||
}
|
||||
cleanup_name:
|
||||
dns_name_free(&tkey->name, mctx);
|
||||
cleanup_key:
|
||||
isc_mem_put(mctx, tkey, sizeof(dns_tsigkey_t));
|
||||
|
||||
return (ret);
|
||||
|
|
@ -1004,9 +992,7 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_rdata;
|
||||
dns_name_init(owner, NULL);
|
||||
ret = dns_name_dup(&key->name, msg->mctx, owner);
|
||||
if (ret != ISC_R_SUCCESS)
|
||||
goto cleanup_owner;
|
||||
dns_name_dup(&key->name, msg->mctx, owner);
|
||||
|
||||
datalist = NULL;
|
||||
ret = dns_message_gettemprdatalist(msg, &datalist);
|
||||
|
|
|
|||
|
|
@ -1613,7 +1613,6 @@ dns_view_flushnode(dns_view_t *view, const dns_name_t *name,
|
|||
|
||||
isc_result_t
|
||||
dns_view_adddelegationonly(dns_view_t *view, const dns_name_t *name) {
|
||||
isc_result_t result;
|
||||
dns_name_t *item;
|
||||
uint32_t hash;
|
||||
|
||||
|
|
@ -1633,17 +1632,13 @@ dns_view_adddelegationonly(dns_view_t *view, const dns_name_t *name) {
|
|||
return (ISC_R_SUCCESS);
|
||||
item = isc_mem_get(view->mctx, sizeof(*item));
|
||||
dns_name_init(item, NULL);
|
||||
result = dns_name_dup(name, view->mctx, item);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
ISC_LIST_APPEND(view->delonly[hash], item, link);
|
||||
else
|
||||
isc_mem_put(view->mctx, item, sizeof(*item));
|
||||
return (result);
|
||||
dns_name_dup(name, view->mctx, item);
|
||||
ISC_LIST_APPEND(view->delonly[hash], item, link);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_view_excludedelegationonly(dns_view_t *view, const dns_name_t *name) {
|
||||
isc_result_t result;
|
||||
dns_name_t *item;
|
||||
uint32_t hash;
|
||||
|
||||
|
|
@ -1663,12 +1658,9 @@ dns_view_excludedelegationonly(dns_view_t *view, const dns_name_t *name) {
|
|||
return (ISC_R_SUCCESS);
|
||||
item = isc_mem_get(view->mctx, sizeof(*item));
|
||||
dns_name_init(item, NULL);
|
||||
result = dns_name_dup(name, view->mctx, item);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
ISC_LIST_APPEND(view->rootexclude[hash], item, link);
|
||||
else
|
||||
isc_mem_put(view->mctx, item, sizeof(*item));
|
||||
return (result);
|
||||
dns_name_dup(name, view->mctx, item);
|
||||
ISC_LIST_APPEND(view->rootexclude[hash], item, link);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -863,7 +863,7 @@ xfrin_create(isc_mem_t *mctx,
|
|||
xfr->axfr.add = NULL;
|
||||
xfr->axfr.add_private = NULL;
|
||||
|
||||
CHECK(dns_name_dup(zonename, mctx, &xfr->name));
|
||||
dns_name_dup(zonename, mctx, &xfr->name);
|
||||
|
||||
CHECK(isc_timer_create(timermgr, isc_timertype_inactive, NULL, NULL,
|
||||
task, xfrin_timeout, xfr, &xfr->timer));
|
||||
|
|
|
|||
|
|
@ -1547,7 +1547,7 @@ dns_zone_setviewrevert(dns_zone_t *zone) {
|
|||
|
||||
isc_result_t
|
||||
dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
|
||||
isc_result_t result;
|
||||
isc_result_t result = ISC_R_SUCCESS;
|
||||
char namebuf[1024];
|
||||
|
||||
REQUIRE(DNS_ZONE_VALID(zone));
|
||||
|
|
@ -1559,7 +1559,7 @@ dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
|
|||
dns_name_free(&zone->origin, zone->mctx);
|
||||
dns_name_init(&zone->origin, NULL);
|
||||
}
|
||||
result = dns_name_dup(origin, zone->mctx, &zone->origin);
|
||||
dns_name_dup(origin, zone->mctx, &zone->origin);
|
||||
|
||||
if (zone->strnamerd != NULL)
|
||||
isc_mem_free(zone->mctx, zone->strnamerd);
|
||||
|
|
@ -1571,8 +1571,9 @@ dns_zone_setorigin(dns_zone_t *zone, const dns_name_t *origin) {
|
|||
zone_name_tostr(zone, namebuf, sizeof namebuf);
|
||||
zone->strname = isc_mem_strdup(zone->mctx, namebuf);
|
||||
|
||||
if (result == ISC_R_SUCCESS && inline_secure(zone))
|
||||
if (inline_secure(zone)) {
|
||||
result = dns_zone_setorigin(zone->raw, origin);
|
||||
}
|
||||
UNLOCK_ZONE(zone);
|
||||
return (result);
|
||||
}
|
||||
|
|
@ -5884,7 +5885,6 @@ set_addrkeylist(unsigned int count,
|
|||
dns_name_t **names, dns_name_t ***newnamesp,
|
||||
isc_mem_t *mctx)
|
||||
{
|
||||
isc_result_t result;
|
||||
isc_sockaddr_t *newaddrs = NULL;
|
||||
isc_dscp_t *newdscp = NULL;
|
||||
dns_name_t **newnames = NULL;
|
||||
|
|
@ -5912,22 +5912,7 @@ set_addrkeylist(unsigned int count,
|
|||
newnames[i] = isc_mem_get(mctx,
|
||||
sizeof(dns_name_t));
|
||||
dns_name_init(newnames[i], NULL);
|
||||
result = dns_name_dup(names[i], mctx,
|
||||
newnames[i]);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
for (i = 0; i < count; i++)
|
||||
if (newnames[i] != NULL)
|
||||
dns_name_free(
|
||||
newnames[i],
|
||||
mctx);
|
||||
isc_mem_put(mctx, newaddrs,
|
||||
count * sizeof(*newaddrs));
|
||||
isc_mem_put(mctx, newdscp,
|
||||
count * sizeof(*newdscp));
|
||||
isc_mem_put(mctx, newnames,
|
||||
count * sizeof(*newnames));
|
||||
return (ISC_R_NOMEMORY);
|
||||
}
|
||||
dns_name_dup(names[i], mctx, newnames[i]);
|
||||
}
|
||||
}
|
||||
} else
|
||||
|
|
@ -12029,11 +12014,9 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) {
|
|||
result = dns_rdata_tostruct(&rdata, &soa, NULL);
|
||||
RUNTIME_CHECK(result == ISC_R_SUCCESS);
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_name_dup(&soa.origin, zone->mctx, &master);
|
||||
dns_name_dup(&soa.origin, zone->mctx, &master);
|
||||
serial = soa.serial;
|
||||
dns_rdataset_disassociate(&soardset);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup3;
|
||||
|
||||
/*
|
||||
* Enqueue notify requests for 'also-notify' servers.
|
||||
|
|
@ -12136,13 +12119,7 @@ zone_notify(dns_zone_t *zone, isc_time_t *now) {
|
|||
if (result != ISC_R_SUCCESS)
|
||||
continue;
|
||||
dns_zone_iattach(zone, ¬ify->zone);
|
||||
result = dns_name_dup(&ns.name, zone->mctx, ¬ify->ns);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
LOCK_ZONE(zone);
|
||||
notify_destroy(notify, true);
|
||||
UNLOCK_ZONE(zone);
|
||||
continue;
|
||||
}
|
||||
dns_name_dup(&ns.name, zone->mctx, ¬ify->ns);
|
||||
LOCK_ZONE(zone);
|
||||
ISC_LIST_APPEND(zone->notifies, notify, link);
|
||||
UNLOCK_ZONE(zone);
|
||||
|
|
|
|||
|
|
@ -131,10 +131,7 @@ configure_key(isc_mem_t *mctx, const cfg_obj_t *key, irs_dnsconf_t *conf,
|
|||
}
|
||||
keyname = isc_mem_get(mctx, sizeof(*keyname));
|
||||
dns_name_init(keyname, NULL);
|
||||
result = dns_name_dup(keyname_base, mctx, keyname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup;
|
||||
}
|
||||
dns_name_dup(keyname_base, mctx, keyname);
|
||||
|
||||
/* Add the key data to the list */
|
||||
keyent = isc_mem_get(mctx, sizeof(*keyent));
|
||||
|
|
|
|||
|
|
@ -199,7 +199,8 @@ convert_keyname(const cfg_obj_t *keyobj, isc_log_t *lctx, isc_mem_t *mctx,
|
|||
txtname);
|
||||
return (result);
|
||||
}
|
||||
return (dns_name_dup(dns_fixedname_name(&fixname), mctx, dnsname));
|
||||
dns_name_dup(dns_fixedname_name(&fixname), mctx, dnsname);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -8983,12 +8983,7 @@ query_synthcnamewildcard(query_ctx_t *qctx, dns_rdataset_t *rdataset,
|
|||
dns_rdata_reset(&rdata);
|
||||
|
||||
dns_name_init(tname, NULL);
|
||||
result = dns_name_dup(&cname.cname, qctx->client->mctx, tname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_message_puttempname(qctx->client->message, &tname);
|
||||
dns_rdata_freestruct(&cname);
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(&cname.cname, qctx->client->mctx, tname);
|
||||
|
||||
dns_rdata_freestruct(&cname);
|
||||
ns_client_qnamereplace(qctx->client, tname);
|
||||
|
|
@ -9608,12 +9603,7 @@ query_cname(query_ctx_t *qctx) {
|
|||
dns_rdata_reset(&rdata);
|
||||
|
||||
dns_name_init(tname, NULL);
|
||||
result = dns_name_dup(&cname.cname, qctx->client->mctx, tname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_message_puttempname(qctx->client->message, &tname);
|
||||
dns_rdata_freestruct(&cname);
|
||||
return (ns_query_done(qctx));
|
||||
}
|
||||
dns_name_dup(&cname.cname, qctx->client->mctx, tname);
|
||||
|
||||
dns_rdata_freestruct(&cname);
|
||||
ns_client_qnamereplace(qctx->client, tname);
|
||||
|
|
@ -9798,11 +9788,7 @@ query_addcname(query_ctx_t *qctx, dns_trust_t trust, dns_ttl_t ttl) {
|
|||
result = dns_message_gettempname(client->message, &aname);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
result = dns_name_dup(client->query.qname, client->mctx, aname);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_message_puttempname(client->message, &aname);
|
||||
return (result);
|
||||
}
|
||||
dns_name_dup(client->query.qname, client->mctx, aname);
|
||||
|
||||
result = dns_message_gettemprdatalist(client->message, &rdatalist);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue