summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Fernandez <jfernandez@igalia.com>2013-06-06 08:25:39 +0000
committerJavier Fernandez <jfernandez@igalia.com>2013-06-06 09:37:45 +0000
commit3f7832bb55451293d460024bbbb0476a3ec3c102 (patch)
treea6f2174353b69c1abc7f9beca164f7e4df1afade
parentbab6150c84cee30219a5dc3386192888f495f3c2 (diff)
Fixed crash at FStatement disposing stage.
Change-Id: I04fb2ded38a12b8501c49ccea81ee72fc7b002d1
-rw-r--r--connectivity/source/drivers/firebird/FStatement.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/connectivity/source/drivers/firebird/FStatement.cxx b/connectivity/source/drivers/firebird/FStatement.cxx
index 9e8a0b906ac7..4194e12f29e2 100644
--- a/connectivity/source/drivers/firebird/FStatement.cxx
+++ b/connectivity/source/drivers/firebird/FStatement.cxx
@@ -94,11 +94,13 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection )
m_OUTsqlda = (XSQLDA *)malloc(XSQLDA_LENGTH(10));
m_OUTsqlda->version = SQLDA_VERSION1;
m_OUTsqlda->sqln = 10;
+ m_OUTsqlda->sqld = 0;
// enabling the XSQLDA to accommodate up to 10 parameter items (DEFAULT)
m_INsqlda = (XSQLDA *)malloc(XSQLDA_LENGTH(10));
m_INsqlda->version = SQLDA_VERSION1;
m_INsqlda->sqln = 10;
+ m_INsqlda->sqld = 0;
m_STMTHandler = NULL; // Set handle to NULL before allocation.
if (isc_dsql_allocate_statement(status, &db, &m_STMTHandler))
@@ -131,17 +133,19 @@ void OStatement_BASE2::disposing()
m_pConnection->release();
m_pConnection = NULL;
- if (m_OUTsqlda)
+ if (NULL != m_OUTsqlda)
{
int i;
XSQLVAR *var;
for (i=0, var = m_OUTsqlda->sqlvar; i < m_OUTsqlda->sqld; i++, var++)
free(var->sqldata);
free(m_OUTsqlda);
+ m_OUTsqlda = NULL;
}
- if (m_INsqlda)
+ if (NULL != m_INsqlda)
{
free(m_INsqlda);
+ m_INsqlda = NULL;
}
ISC_STATUS_ARRAY status; // status vector