Skip to content

Commit

Permalink
Deallocate the old MySQL connection on connect if one exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
SadieCat committed May 3, 2024
1 parent bef8335 commit c7ae694
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/extra/m_mysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c7ae694

Please sign in to comment.