diff options
| author | 2024-05-02 16:19:18 +0100 | |
|---|---|---|
| committer | 2024-05-03 09:28:33 +0100 | |
| commit | c7ae694b50d1a1d7ed2b30967a1736633311e1a2 (patch) | |
| tree | baec1bab558f6d931d2287967645f06aae7f3ee4 /src/modules | |
| parent | Update irctest. (diff) | |
Deallocate the old MySQL connection on connect if one exists.
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/extra/m_mysql.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index f5337b938..2f5c64e43 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -334,6 +334,12 @@ class SQLConnection : public SQL::Provider // true upon success. bool Connect() { + if (connection) + { + mysql_close(connection); + connection = NULL; + } + connection = mysql_init(connection); // Set the connection timeout. |
