From 3765c691250be52032943c152c2f4fe524686ae8 Mon Sep 17 00:00:00 2001 From: peavey Date: Mon, 17 Mar 2008 22:25:21 +0000 Subject: Its better to have asserted and failed, than not to fail at all according to tds. Fix assertion error on DB down. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9118 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_mssql.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/modules') diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp index 5128693c7..74886863d 100644 --- a/src/modules/extra/m_mssql.cpp +++ b/src/modules/extra/m_mssql.cpp @@ -294,6 +294,9 @@ class SQLConn : public classbase SQLerror Query(SQLrequest &req) { + if (!sock) + return SQLerror(BAD_CONN, "Socket was NULL, check if SQL server is running."); + /* Pointer to the buffer we screw around with substitution in */ char* query; @@ -500,6 +503,9 @@ class SQLConn : public classbase tds_free_socket(sock); if (conn) tds_free_connection(conn); + login = NULL; + sock = NULL; + conn = NULL; } SQLhost GetConfHost() -- cgit v1.2.3