QDBusServer: Fix uninitialized member
If you used the QString constructor overload and passed an empty address, the d pointer would remain uninitialized. Found by Coverity, CID 11724. Change-Id: I42e7ef1a481840699a8dffff1407ead3ee703d6e Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
This commit is contained in:
parent
7dc0f42e78
commit
c401506ffc
@ -54,15 +54,13 @@ QT_BEGIN_NAMESPACE
|
|||||||
\a parent.
|
\a parent.
|
||||||
*/
|
*/
|
||||||
QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent), d(0)
|
||||||
{
|
{
|
||||||
if (address.isEmpty())
|
if (address.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!qdbus_loadLibDBus()) {
|
if (!qdbus_loadLibDBus())
|
||||||
d = 0;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
emit QDBusConnectionManager::instance()->serverRequested(address, this);
|
emit QDBusConnectionManager::instance()->serverRequested(address, this);
|
||||||
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
|
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user