]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 5337: workaround for crash on startup if -a option is used (#1653)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Thu, 1 Feb 2024 06:05:40 +0000 (06:05 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Thu, 1 Feb 2024 06:05:52 +0000 (06:05 +0000)
Interpreting command-line arguments requires AnyP::UriScheme to be fully
initialized. Initialize AnyP::UriScheme earlier to ensure that happens.

src/main.cc

index c5437ff1489cc5e7e2e8087fd645a58f2520314c..040c7f1e7b5bcdadcc025b586ba445ce9e2fc8f4 100644 (file)
@@ -1535,6 +1535,7 @@ SquidMain(int argc, char **argv)
     WIN32_svcstatusupdate(SERVICE_START_PENDING, 10000);
 
 #endif
+    AnyP::UriScheme::Init(); // needs to be before arg parsing, bug 5337
 
     cmdLine.forEachOption(mainHandleCommandLineOption);
 
@@ -1576,8 +1577,6 @@ SquidMain(int argc, char **argv)
 
         Mem::Init();
 
-        AnyP::UriScheme::Init();
-
         storeFsInit();      /* required for config parsing */
 
         Fs::Init();