Initialize pointer to a default value

This commit is contained in:
Chocobo1 2022-06-23 12:28:00 +08:00
parent 6de72ecc77
commit 02d906d3ae
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
77 changed files with 178 additions and 202 deletions

View file

@ -74,7 +74,6 @@ using namespace Http;
Server::Server(IRequestHandler *requestHandler, QObject *parent)
: QTcpServer(parent)
, m_requestHandler(requestHandler)
, m_https(false)
{
setProxy(QNetworkProxy::NoProxy);
@ -91,7 +90,7 @@ void Server::incomingConnection(const qintptr socketDescriptor)
{
if (m_connections.size() >= CONNECTIONS_LIMIT) return;
QTcpSocket *serverSocket;
QTcpSocket *serverSocket = nullptr;
if (m_https)
serverSocket = new QSslSocket(this);
else