From: Yann Ylavic Date: Wed, 25 Nov 2020 01:56:17 +0000 (+0000) Subject: mod_auth_digest: fix crash with ONE_PROCESS (debug) mode shutdown. X-Git-Tag: 2.5.0-alpha2-ci-test-only~1123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07e4fa6e5185659a0fcbf12dc88c9f23ff8d4860;p=thirdparty%2Fapache%2Fhttpd.git mod_auth_digest: fix crash with ONE_PROCESS (debug) mode shutdown. Avoid double free/cleanup by just letting shm/rmm/global_mutex cleanups do their work on restart/exit. Set the globals to NULL in initialize_tables() should cleanup_tables() be called on error. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883810 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index 12097842780..480f43bf164 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -261,6 +261,12 @@ static int initialize_tables(server_rec *s, apr_pool_t *ctx) /* Create the shared memory segment */ + client_shm = NULL; + client_rmm = NULL; + client_lock = NULL; + opaque_lock = NULL; + client_list = NULL; + /* * Create a unique filename using our pid. This information is * stashed in the global variable so the children inherit it. @@ -407,8 +413,6 @@ static int initialize_module(apr_pool_t *p, apr_pool_t *plog, if (initialize_tables(s, p) != OK) { return !OK; } - /* Call cleanup_tables on exit or restart */ - apr_pool_cleanup_register(p, NULL, cleanup_tables, apr_pool_cleanup_null); #endif /* APR_HAS_SHARED_MEMORY */ return OK; }