]> granicus.if.org Git - icinga2/commitdiff
Fix crash in Ido*Connection::InternalExecuteMultipleQueries
authorGunnar Beutner <gunnar@beutner.name>
Wed, 16 Dec 2015 10:29:06 +0000 (11:29 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 16 Dec 2015 10:29:06 +0000 (11:29 +0100)
fixes #10862

lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.cpp

index 6ea1dcfbe5634132b98087328c210e7892a4a2fc..3a20e47ac52dd9e2029af711a6ec42563a7a7493 100644 (file)
@@ -813,6 +813,9 @@ void IdoMysqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
 {
        AssertOnWorkQueue();
 
+       if (!GetConnected())
+               return;
+
        BOOST_FOREACH(const DbQuery& query, queries) {
                ASSERT(query.Category != DbCatInvalid);
 
index ac312cf3f985dbc8992f347f781887d771450e4d..809ace7ca6fb5d3fcf609bb5f536bfbaabd1f7de 100644 (file)
@@ -691,6 +691,9 @@ void IdoPgsqlConnection::InternalExecuteMultipleQueries(const std::vector<DbQuer
 {
        AssertOnWorkQueue();
 
+       if (!GetConnected())
+               return;
+
        BOOST_FOREACH(const DbQuery& query, queries) {
                ASSERT(query.Category != DbCatInvalid);