From 40747ee2ad5621d5cc0d8afe59d1f36c2b191711 Mon Sep 17 00:00:00 2001 From: peavey Date: Fri, 27 Mar 2009 18:20:49 +0000 Subject: Fix potential crash on uninitialised var git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11267 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_mysql.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index d0716bd90..824a75e46 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -773,6 +773,7 @@ void DispatcherThread::Run() LoadDatabases(Parent->Conf, Parent->PublicServerInstance, Parent); } + conn = NULL; Parent->ConnMutex.Lock(); for (ConnMap::iterator i = Connections.begin(); i != Connections.end(); i++) { @@ -806,9 +807,10 @@ void DispatcherThread::Run() void DispatcherThread::OnNotify() { + SQLConnection* conn; while (1) { - SQLConnection* conn = NULL; + conn = NULL; Parent->ConnMutex.Lock(); for (ConnMap::iterator iter = Connections.begin(); iter != Connections.end(); iter++) { -- cgit v1.2.3