summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-08-16 17:56:12 +0200
committerAndras Timar <andras.timar@collabora.com>2018-08-28 20:29:26 +0200
commit6a232a01f9075b930b05e36a4979e8d58aeb74d3 (patch)
tree4b5905460a7fb7c2f004c1a914b3023eab578472 /connectivity
parent490c6cd0ed877a0bd22a7592b42d70edd83114ca (diff)
mysqlc: Fix issue by freeing result sets
Change-Id: I8a5f886306e028f06243768376b2a6c55df6063c Reviewed-on: https://gerrit.libreoffice.org/59210 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/59714 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx3
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_statement.cxx6
2 files changed, 6 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index 24e2b2560968..c52b587fba55 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -32,6 +32,8 @@
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <sal/log.hxx>
+
using namespace rtl;
#include <comphelper/string.hxx>
@@ -559,6 +561,7 @@ void SAL_CALL OResultSet::close()
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
mysql_free_result(m_pResult);
+ m_pResult = nullptr;
dispose();
}
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 97cd50969879..cc6bf1492502 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -61,10 +61,10 @@ OCommonStatement::~OCommonStatement() {}
void OCommonStatement::disposeResultSet()
{
// free the cursor if alive
- if (m_pMysqlResult != nullptr)
+ if (m_xResultSet.is())
{
- mysql_free_result(m_pMysqlResult);
- m_pMysqlResult = nullptr;
+ m_xResultSet.clear();
+ m_pMysqlResult = nullptr; // it is freed by XResultSet
}
}