[ONGERRIT] leaked ODBC statement handles

Lionel Elie Mamane lionel at mamane.lu
Thu Jul 19 03:43:30 PDT 2012


On Wed, Jul 18, 2012 at 03:09:55PM -0400, Terrence Enger wrote:
> Patch attached.  I think it as we discussed.

Thanks. Applied & pushed to master.

I split your patch into three commits:

 - avoid freeing the NULL handle

 - ODBMetaDataRS ctor: abort if statement handle allocation failed

 - stop some leaked statement handles

In particular, in the "ODBMetaDataRS ctor: abort if statement handle
allocation failed" commit, I moved the abort (exception throwing) to
the top of the function instead of the bottom. At the bottom, it would
leak the allocation in m_pRowStatusArray, and a reference count in
m_pConnection (because acquire has already been called).

By contrast, the other initialisations done before, in the
initialisation list are safe: no heap allocation :)

-- 
Lionel


More information about the LibreOffice mailing list