[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:29:43 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=7a67274

The following commit has been merged in the master branch:
commit 7a67274a18dcc1085fbcbc7cdffcb6a79eb3dd27
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Thu Jun 2 12:17:07 2016 +0200

    Fixed memory leak.
---
 core/backends/lan/lanlinkprovider.cpp | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp
index 5ffb528..3281636 100644
--- a/core/backends/lan/lanlinkprovider.cpp
+++ b/core/backends/lan/lanlinkprovider.cpp
@@ -244,8 +244,7 @@ void LanLinkProvider::connected()
         mUdpSocket.writeDatagram(np2.serialize(), receivedIdentityPackages[socket].sender, port);
     }
 
-    delete receivedPackage;
-    receivedIdentityPackages.remove(socket);
+    delete receivedIdentityPackages.take(socket).np;
     //We don't delete the socket because now it's owned by the LanDeviceLink
 }
 
@@ -265,8 +264,7 @@ void LanLinkProvider::encrypted()
     addLink(deviceId, socket, receivedPackage, LanDeviceLink::Remotely);
 
     // Copied from connected slot, now delete received package
-    delete receivedPackage;
-    receivedIdentityPackages.remove(socket);
+    delete receivedIdentityPackages.take(socket).np;
 
 }
 
@@ -342,8 +340,14 @@ void LanLinkProvider::dataReceived()
     NetworkPackage* np = new NetworkPackage("");
     bool success = NetworkPackage::unserialize(data, np);
 
-    if (!success || np->type() != PACKAGE_TYPE_IDENTITY) {
-        qCDebug(KDECONNECT_CORE) << "LanLinkProvider/newConnection: Not an identification package (wuh?)";
+    if (!success) {
+        delete np;
+        return;
+    }
+
+    if (np->type() != PACKAGE_TYPE_IDENTITY) {
+        qCWarning(KDECONNECT_CORE) << "LanLinkProvider/newConnection: Expected identity, received " << np->type();
+        delete np;
         return;
     }
 
@@ -379,14 +383,10 @@ void LanLinkProvider::dataReceived()
         connect(socket, SIGNAL(encrypted()), this, SLOT(encrypted()));
 
         socket->startClientEncryption();
-        return;
     } else {
         addLink(deviceId, socket, np, LanDeviceLink::Locally);
+        delete receivedIdentityPackages.take(socket).np;
     }
-
-    delete np;
-    receivedIdentityPackages.remove(socket);
-
 }
 
 void LanLinkProvider::deviceLinkDestroyed(QObject* destroyedDeviceLink)

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list