Skip to content

Commit

Permalink
Fix HSTMT leak.
Browse files Browse the repository at this point in the history
For each new connection string (so usually once per app for most apps), pyodbc caches driver
configuration information.  During this an HSTMT was not freed.  Note that this should not have
had any affect since the call to SQLDisconnect later should free all handles.  (I may have even
not freed on purpose earlier, but I don't remember which is a good sign that closing it
explicitly would be better.)
  • Loading branch information
mkleehammer committed Dec 21, 2016
1 parent 5a56e1b commit ca6fc10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cnxninfo.cpp
Expand Up @@ -151,6 +151,8 @@ static PyObject* CnxnInfo_New(Connection* cnxn)
p->datetime_precision = (int)columnsize;
SQLFreeStmt(hstmt, SQL_CLOSE);
}

SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
}

Py_END_ALLOW_THREADS
Expand Down

0 comments on commit ca6fc10

Please sign in to comment.