diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp
index e4695d135..2885bf217 100644
--- a/lib/remote/apilistener.cpp
+++ b/lib/remote/apilistener.cpp
@@ -220,7 +220,7 @@ void ApiListener::Start(bool runtimeCreated)
 	ObjectImpl<ApiListener>::Start(runtimeCreated);
 
 	{
-		boost::mutex::scoped_lock(m_LogLock);
+		boost::mutex::scoped_lock lock(m_LogLock);
 		RotateLogFile();
 		OpenLogFile();
 	}