mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Fix KASP key leaks on keystore lookup failure
In both cfg_kasp_fromconfig() and cfg_kasp_builtinconfig(), the
newly allocated KASP key was not destroyed when the keystore
lookup failed.
(cherry picked from commit df1993611b)
This commit is contained in:
parent
769dff3e6f
commit
338961bf7e
1 changed files with 2 additions and 0 deletions
|
|
@ -852,6 +852,7 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, dns_kasp_t *default_kasp,
|
|||
"find keystore (%s)",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
dns_kasp_key_destroy(new_key);
|
||||
goto cleanup;
|
||||
}
|
||||
dns_kasp_addkey(kasp, new_key);
|
||||
|
|
@ -972,6 +973,7 @@ cfg_kasp_builtinconfig(isc_mem_t *mctx, const char *name,
|
|||
DNS_KEYSTORE_KEYDIRECTORY,
|
||||
&new_key->keystore);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
dns_kasp_key_destroy(new_key);
|
||||
goto cleanup;
|
||||
}
|
||||
dns_kasp_addkey(kasp, new_key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue