From: Mark Andrews Date: Tue, 5 Nov 2019 02:38:00 +0000 (+1100) Subject: move appending kasp to the list until we can't fail; document why we don't detach X-Git-Tag: v9.15.6~26^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce1c1631b35794ff516789f01ec791e1f3162fe0;p=thirdparty%2Fbind9.git move appending kasp to the list until we can't fail; document why we don't detach --- diff --git a/lib/isccfg/kaspconf.c b/lib/isccfg/kaspconf.c index b1111f68911..b39eb9c44c5 100644 --- a/lib/isccfg/kaspconf.c +++ b/lib/isccfg/kaspconf.c @@ -143,10 +143,6 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, isc_mem_t* mctx, } INSIST(kasp != NULL); - /* Append it to the list for future lookups. */ - ISC_LIST_APPEND(*kasplist, kasp, link); - ISC_INSIST(!(ISC_LIST_EMPTY(*kasplist))); - /* Now configure. */ INSIST(DNS_KASP_VALID(kasp)); @@ -211,8 +207,13 @@ cfg_kasp_fromconfig(const cfg_obj_t *config, isc_mem_t* mctx, // TODO: Rest of the configuration + /* Append it to the list for future lookups. */ + ISC_LIST_APPEND(*kasplist, kasp, link); + ISC_INSIST(!(ISC_LIST_EMPTY(*kasplist))); + /* Success: Attach the kasp to the pointer and return. */ dns_kasp_attach(kasp, kaspp); + /* Don't detach as kasp is on '*kasplist' */ return (ISC_R_SUCCESS); cleanup: