]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish: initialize the main PortCfg pointers
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 25 Jan 2013 10:52:46 +0000 (03:52 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 25 Jan 2013 10:52:46 +0000 (03:52 -0700)
* Only the main pointers for now, the rest can wait on some additional
  cleanup patches undergoing testing.

 Fixes defects detected by Coverity Scan. Issue 740501 and some of 740535

src/anyp/PortCfg.cc

index 8a90b72226c1f51b7545c40b1b82e0b560c897dc..3025c2284ababf86ad72ecfe03401e32edde4014 100644 (file)
@@ -13,14 +13,15 @@ CBDATA_NAMESPACED_CLASS_INIT(AnyP, PortCfg);
 int NHttpSockets = 0;
 int HttpSockets[MAXTCPLISTENPORTS];
 
-AnyP::PortCfg::PortCfg(const char *aProtocol)
+AnyP::PortCfg::PortCfg(const char *aProtocol) :
+        next(NULL),
+        protocol(xstrdup(aProtocol)),
+        name(NULL),
+        defaultsite(NULL)
 #if USE_SSL
-        :
-        dynamicCertMemCacheSize(std::numeric_limits<size_t>::max())
+        ,dynamicCertMemCacheSize(std::numeric_limits<size_t>::max())
 #endif
-{
-    protocol = xstrdup(aProtocol);
-}
+{}
 
 AnyP::PortCfg::~PortCfg()
 {
@@ -94,7 +95,8 @@ AnyP::PortCfg::clone() const
 }
 
 #if USE_SSL
-void AnyP::PortCfg::configureSslServerContext()
+void
+AnyP::PortCfg::configureSslServerContext()
 {
     if (cert)
         Ssl::readCertChainAndPrivateKeyFromFiles(signingCert, signPkey, certsToChain, cert, key);