]> granicus.if.org Git - icinga2/commitdiff
Add missing "return"s in Ido*Connection::Reconnect
authorGunnar Beutner <gunnar@beutner.name>
Thu, 5 Mar 2015 14:57:46 +0000 (15:57 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 5 Mar 2015 14:57:46 +0000 (15:57 +0100)
lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp

index 9906de942340a80fb59789be890954d8f0dfb578..153b11e34ab273ad65f4a79ea91b3329a8f8fd06 100644 (file)
@@ -226,6 +226,7 @@ void IdoMysqlConnection::Reconnect(void)
                        Log(LogCritical, "IdoMysqlConnection", "Schema does not provide any valid version! Verify your schema installation.");
 
                        Application::RequestShutdown(EXIT_FAILURE);
+                       return;
                }
 
                DiscardRows(result);
@@ -238,6 +239,7 @@ void IdoMysqlConnection::Reconnect(void)
                            << SCHEMA_VERSION << "'! Please check the upgrade documentation.";
 
                        Application::RequestShutdown(EXIT_FAILURE);
+                       return;
                }
 
                String instanceName = GetInstanceName();
index fa9b935cf01dc29822e1fcf6e5e7f9cbb97614c3..dcbc292c55de3c519b718a28b182d3bf93307d2f 100644 (file)
@@ -223,19 +223,27 @@ void IdoPgsqlConnection::Reconnect(void)
                Dictionary::Ptr row = FetchRow(result, 0);
 
                if (!row) {
+                       PQfinish(m_Connection);
+                       m_Connection = NULL;
+
                        Log(LogCritical, "IdoPgsqlConnection", "Schema does not provide any valid version! Verify your schema installation.");
 
                        Application::RequestShutdown(EXIT_FAILURE);
+                       return;
                }
 
                String version = row->Get("version");
 
                if (Utility::CompareVersion(SCHEMA_VERSION, version) < 0) {
+                       PQfinish(m_Connection);
+                       m_Connection = NULL;
+
                        Log(LogCritical, "IdoPgsqlConnection")
                            << "Schema version '" << version << "' does not match the required version '"
                            << SCHEMA_VERSION << "'! Please check the upgrade documentation.";
 
                        Application::RequestShutdown(EXIT_FAILURE);
+                       return;
                }
 
                String instanceName = GetInstanceName();