Fix possible deadlock in error conditions
authorsapier <Sapier at GMX dot net>
Sat, 10 May 2014 22:14:57 +0000 (00:14 +0200)
committersapier <Sapier at GMX dot net>
Sat, 10 May 2014 22:14:57 +0000 (00:14 +0200)
src/server.cpp

index 288f254ed5b815b27bb357253f5d41f90f76c085..22efca67082e54fe02d0b4be85c109a1dbb0a1a1 100644 (file)
@@ -2894,8 +2894,10 @@ bool Server::getClientInfo(
        m_clients.Lock();
        RemoteClient* client = m_clients.lockedGetClientNoEx(peer_id,Invalid);
 
-       if (client == NULL)
+       if (client == NULL) {
+               m_clients.Unlock();
                return false;
+               }
 
        *uptime = client->uptime();
        *ser_vers = client->serialization_version;