From 235595362f40bdb0a6f4671afc5b370e3ec73675 Mon Sep 17 00:00:00 2001 From: Yan Shapochnik Date: Wed, 11 Apr 2012 11:29:43 -0400 Subject: 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 Reviewed-by: Janne Anttila Reviewed-by: Honglei Zhang --- src/sql/drivers/odbc/qsql_odbc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit v0.12