summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorYan Shapochnik <shapochniky@seapine.com>2012-04-11 15:29:43 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-04-20 06:13:51 (GMT)
commit235595362f40bdb0a6f4671afc5b370e3ec73675 (patch)
tree2ab7c90b3de950616602ebf13bf49a6a539dedcf /src/sql
parent1ee610f8fd1195026405a6f2da0d213c5da8816a (diff)
downloadQt-235595362f40bdb0a6f4671afc5b370e3ec73675.zip
Qt-235595362f40bdb0a6f4671afc5b370e3ec73675.tar.gz
Qt-235595362f40bdb0a6f4671afc5b370e3ec73675.tar.bz2
Fix for memory leak in 64 bit ODBC driver's call to SQLGetStmtAttr()
Windows API call to SQLGetStmtAttr() attempts to place an 8 byte value into the isScrollable variable which of type SQLINTEGER which is a long and is 32 bit on Windows even when the driver is compiled for 64 bit. Changing the isScrollable to and 8 byte SQLULEN type. Task-number: QTBUG-25256 Change-Id: I1aae0b306e8d1ff5fc3b293b3e9ddd40546b85ad Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Janne Anttila <janne.anttila@digia.com> Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 0bae8c9..9c3f6fc 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -1590,7 +1590,8 @@ bool QODBCResult::exec()
return false;
}
- SQLINTEGER isScrollable, bufferLength;
+ SQLULEN isScrollable = 0;
+ SQLINTEGER bufferLength;
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);