]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 2 Feb 2024 19:29:50 +0000 (08:29 +1300)
Interpreting command-line arguments requires AnyP::UriScheme to be fully
initialized. Initialize AnyP::UriScheme earlier to ensure that happens.

src/main.cc

index 3706dd848e3b30a8f6b78ca3455bc042e33147be..1a2660260572c000951c126ee5aaa2359642ea2f 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();