]> granicus.if.org Git - icinga2/commitdiff
Fix missing variable name which can lead to segfaults
authorGunnar Beutner <gunnar.beutner@icinga.com>
Mon, 27 Nov 2017 15:06:59 +0000 (16:06 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Tue, 28 Nov 2017 10:14:32 +0000 (11:14 +0100)
refs #5808
refs #5807

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
lib/remote/apilistener.cpp

index 86cc797594f30b0fa41c01591f660747d1572415..b00c37f6a3d952e00277df23619d08fe88c28196 100644 (file)
@@ -1354,37 +1354,37 @@ double ApiListener::CalculateZoneLag(const Endpoint::Ptr& endpoint)
 
 void ApiListener::AddAnonymousClient(const JsonRpcConnection::Ptr& aclient)
 {
-       boost::mutex::scoped_lock(m_AnonymousClientsLock);
+       boost::mutex::scoped_lock lock(m_AnonymousClientsLock);
        m_AnonymousClients.insert(aclient);
 }
 
 void ApiListener::RemoveAnonymousClient(const JsonRpcConnection::Ptr& aclient)
 {
-       boost::mutex::scoped_lock(m_AnonymousClientsLock);
+       boost::mutex::scoped_lock lock(m_AnonymousClientsLock);
        m_AnonymousClients.erase(aclient);
 }
 
 std::set<JsonRpcConnection::Ptr> ApiListener::GetAnonymousClients(void) const
 {
-       boost::mutex::scoped_lock(m_AnonymousClientsLock);
+       boost::mutex::scoped_lock lock(m_AnonymousClientsLock);
        return m_AnonymousClients;
 }
 
 void ApiListener::AddHttpClient(const HttpServerConnection::Ptr& aclient)
 {
-       boost::mutex::scoped_lock(m_HttpClientsLock);
+       boost::mutex::scoped_lock lock(m_HttpClientsLock);
        m_HttpClients.insert(aclient);
 }
 
 void ApiListener::RemoveHttpClient(const HttpServerConnection::Ptr& aclient)
 {
-       boost::mutex::scoped_lock(m_HttpClientsLock);
+       boost::mutex::scoped_lock lock(m_HttpClientsLock);
        m_HttpClients.erase(aclient);
 }
 
 std::set<HttpServerConnection::Ptr> ApiListener::GetHttpClients(void) const
 {
-       boost::mutex::scoped_lock(m_HttpClientsLock);
+       boost::mutex::scoped_lock lock(m_HttpClientsLock);
        return m_HttpClients;
 }