diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/db/plugins/ProxyDatabasePlugin.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/db/plugins/ProxyDatabasePlugin.cxx b/src/db/plugins/ProxyDatabasePlugin.cxx index e46b4b9e8..0ab25005a 100644 --- a/src/db/plugins/ProxyDatabasePlugin.cxx +++ b/src/db/plugins/ProxyDatabasePlugin.cxx @@ -353,19 +353,19 @@ ProxyDatabase::Connect(Error &error) return false; } + if (!CheckError(connection, error)) { + mpd_connection_free(connection); + connection = nullptr; + + return false; + } + idle_received = unsigned(-1); is_idle = false; SocketMonitor::Open(mpd_async_get_fd(mpd_connection_get_async(connection))); IdleMonitor::Schedule(); - if (!CheckError(connection, error)) { - if (connection != nullptr) - Disconnect(); - - return false; - } - return true; } |