Commit 97135e70 authored by Montel Laurent's avatar Montel Laurent Committed by Nicolas Arnaud-Cormos

Fix memory leak when sdRef is null

Change-Id: I903683e5d91d96f43bf88b571fac2f2d18f07e25
Reviewed-by: Nicolas Arnaud-Cormos's avatarNicolas Arnaud-Cormos <nicolas@kdab.com>
parent 935b60b9
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment