summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2012-04-26 13:17:40 +0300
committerQt by Nokia <qt-info@nokia.com>2012-04-26 17:52:12 +0200
commit1509316a37fb2d365230d020d1dfc251c830fd56 (patch)
tree087b5aeb5b78703c6ecdf953c8e347efbe26c9d2 /src
parentf3721d77067d4d0f81971a4bfb1bb135bf146d8a (diff)
Fix memory leaks in 64-bits ODBC driver
On 64-bits Windows system, integers and longs are still 4 bytes values. Several functions that were previously defined with SQLINTEGER and SQLUINTEGER parameters have been changed where appropiate to use new SQLLEN and SQLULEN typedefs. SQLGetStmtAttr() is one of these functions. This fix replaces SQLINTEGER with SQLULEN in appropriate functions to avoid memory leaks. Task-number: QTBUG-25256 Change-Id: I744927f42b8578ece60815df360e3b337ebf452a Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Diffstat (limited to 'src')
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index f503f64cdf..04bc0cc894 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -962,7 +962,8 @@ bool QODBCResult::reset (const QString& query)
return true;
}
- SQLINTEGER isScrollable, bufferLength;
+ SQLINTEGER bufferLength;
+ SQLULEN isScrollable;
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE);
@@ -1584,7 +1585,8 @@ bool QODBCResult::exec()
return false;
}
- SQLINTEGER isScrollable, bufferLength;
+ SQLINTEGER bufferLength;
+ SQLULEN isScrollable;
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE);