Ensure QDBusConnectionPrivate pointer initialization

Change-Id: Id7ca5b412462b5d7a18d12f9a227fdf9ef7b2344
Coverity-Id: 180869
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Jesus Fernandez 2017-06-06 15:46:18 +02:00 committed by Jesus Fernandez
parent 5b24f0a6bb
commit e400b7e326

View File

@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
\a parent.
*/
QDBusServer::QDBusServer(const QString &address, QObject *parent)
: QObject(parent), d(0)
: QObject(parent), d(nullptr)
{
if (address.isEmpty())
return;
@ -83,7 +83,7 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
localhost (elsewhere).
*/
QDBusServer::QDBusServer(QObject *parent)
: QObject(parent)
: QObject(parent), d(nullptr)
{
#ifdef Q_OS_UNIX
// Use Unix sockets on Unix systems only
@ -92,10 +92,8 @@ QDBusServer::QDBusServer(QObject *parent)
const QString address = QStringLiteral("tcp:");
#endif
if (!qdbus_loadLibDBus()) {
d = 0;
if (!qdbus_loadLibDBus())
return;
}
QDBusConnectionManager *instance = QDBusConnectionManager::instance();
if (!instance)