From 04f0004e0d593ce9d390ce18ec1abe1237f8c81b Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 25 Jan 2013 03:52:46 -0700 Subject: [PATCH] Polish: initialize the main PortCfg pointers * 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 | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/anyp/PortCfg.cc b/src/anyp/PortCfg.cc index 8a90b72226..3025c2284a 100644 --- a/src/anyp/PortCfg.cc +++ b/src/anyp/PortCfg.cc @@ -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::max()) + ,dynamicCertMemCacheSize(std::numeric_limits::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); -- 2.47.3