summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-09-02 00:15:59 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-09-02 00:15:59 +0200
commit8125a187b17f41a199cc4ebaa99f4d616e930049 (patch)
tree7947dba4466a4e45eea20732f966594f8202f13b /src
parentf41b5c2b4e8b69a871a4d7d00fa8df3dd3786dad (diff)
m_sqlite3 Fix cleanup of unsuccessful database connections
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_sqlite3.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index 7f6a53359..1e3a65a18 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -97,8 +97,11 @@ class SQLConn : public SQLProvider
~SQLConn()
{
- sqlite3_interrupt(conn);
- sqlite3_close(conn);
+ if (conn)
+ {
+ sqlite3_interrupt(conn);
+ sqlite3_close(conn);
+ }
}
void Query(SQLQuery* query, const std::string& q)