mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-10 10:11:39 -04:00
fix: dev: Fix adbname reference
Call `dns_adbname_ref` before calling `dns_resolver_createfetch` to ensure `adbname->name` remains stable for the life of the fetch. Closes #5239 Merge branch '5239-fix-adb-reference-counting' into 'main' See merge request isc-projects/bind9!10290
This commit is contained in:
commit
49ecb158d4
1 changed files with 2 additions and 2 deletions
|
|
@ -2909,6 +2909,7 @@ fetch_name(dns_adbname_t *adbname, bool start_at_zone, bool no_validation,
|
|||
* createfetch to find deepest cached name when we're providing
|
||||
* domain and nameservers.
|
||||
*/
|
||||
dns_adbname_ref(adbname);
|
||||
result = dns_resolver_createfetch(
|
||||
adb->res, adbname->name, type, name, nameservers, NULL, NULL, 0,
|
||||
options, depth, qc, gqc, isc_loop(), fetch_callback, adbname,
|
||||
|
|
@ -2916,11 +2917,10 @@ fetch_name(dns_adbname_t *adbname, bool start_at_zone, bool no_validation,
|
|||
if (result != ISC_R_SUCCESS) {
|
||||
DP(ENTER_LEVEL, "fetch_name: createfetch failed with %s",
|
||||
isc_result_totext(result));
|
||||
dns_adbname_unref(adbname);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
dns_adbname_ref(adbname);
|
||||
|
||||
if (type == dns_rdatatype_a) {
|
||||
adbname->fetch_a = fetch;
|
||||
inc_resstats(adb, dns_resstatscounter_gluefetchv4);
|
||||
|
|
|
|||
Loading…
Reference in a new issue