diff options
author | Montel Laurent <laurent.montel@kdab.com> | 2013-01-14 11:26:08 +0100 |
---|---|---|
committer | Nicolas Arnaud-Cormos <nicolas@kdab.com> | 2013-01-21 07:48:52 +0100 |
commit | 97135e70f25aa53a6fbb354833289e5ed0a06f11 (patch) | |
tree | 4da3559ed8493e8c59360ff5659374d5ea83f89f | |
parent | 935b60b9939de0372e9a96e9459e4a5f1779690d (diff) | |
download | qt-creator-97135e70f25aa53a6fbb354833289e5ed0a06f11.tar.gz |
Fix memory leak when sdRef is null
Change-Id: I903683e5d91d96f43bf88b571fac2f2d18f07e25
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
-rw-r--r-- | src/libs/zeroconf/avahiLib.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs/zeroconf/avahiLib.cpp b/src/libs/zeroconf/avahiLib.cpp index 06fa0173e9..526ee563e9 100644 --- a/src/libs/zeroconf/avahiLib.cpp +++ b/src/libs/zeroconf/avahiLib.cpp @@ -322,12 +322,12 @@ public: DNSServiceErrorType createConnection(MainConnection *mainConnection, ConnectionRef *sdRef) { if (!m_simplePollNew || !m_clientNew || !m_simplePollSetFunc) return kDNSServiceErr_Unknown; - MyAvahiConnection *connection = new MyAvahiConnection; - connection->lib = this; if (sdRef == 0) { qDebug() << "Error: sdRef is null in createConnection"; return kDNSServiceErr_Unknown; } + MyAvahiConnection *connection = new MyAvahiConnection; + connection->lib = this; /* Allocate main loop object */ connection->simple_poll = m_simplePollNew(); if (!connection->simple_poll) { |