From: Ondřej Surý Date: Thu, 26 Oct 2023 08:54:28 +0000 (+0200) Subject: Fix assertion failure when using -X and lock-file in configuration X-Git-Tag: v9.19.18~19^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f68def5e966f0d359833b64837e25f0cb60fb6a;p=thirdparty%2Fbind9.git Fix assertion failure when using -X and lock-file in configuration When 'lock-file ' was used in configuration at the same time as using `-X ` in `named` invocation, there was an invalid logic that would lead to a double isc_mem_strdup() call on the value. Skip the second allocation if `lock-file` is being used in configuration, so the is used only single time. --- diff --git a/bin/named/server.c b/bin/named/server.c index 9333d206c85..e2d49b7341d 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8187,10 +8187,7 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config, if (server->lockfile == NULL) { return (ISC_R_NOMEMORY); } - } - - if (named_g_forcelock && named_g_defaultlockfile != NULL) { - INSIST(server->lockfile == NULL); + } else if (named_g_forcelock && named_g_defaultlockfile != NULL) { server->lockfile = isc_mem_strdup(server->mctx, named_g_defaultlockfile); }