summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_mssql.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-17 22:25:21 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-17 22:25:21 +0000
commit3765c691250be52032943c152c2f4fe524686ae8 (patch)
tree14a0441aee4e962fe316efe3fd2220f23445e09b /src/modules/extra/m_mssql.cpp
parent43a376fd68197db472472db78afd7bb5545fde38 (diff)
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
Diffstat (limited to 'src/modules/extra/m_mssql.cpp')
-rw-r--r--src/modules/extra/m_mssql.cpp6
1 files changed, 6 insertions, 0 deletions
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()