[unixODBC-dev] Right way to read odbc.ini file.

Nick Gorham nick at easysoft.com
Fri Sep 10 11:40:23 BST 2004

ZIGLIO, Frediano, VF-IT wrote:

> In our driver (FreeTDS ODBC driver) in SQLConnect we read odbc.ini using
> SQLGetPrivateProfileString from libodbcinst.so. However I noted that
> this lead to some leaks due to ini cache. SQLGetPrivateProfileString
> it's also compiled in libodbc.so but it's not exported. This lead to two
> different caches (but I don't think it's a problem). The real issue it's
> that when our driver get unloaded (unixODBC calls lt_dlclose)
> libodbcinst.so get unloaded but cache it's not freed... Perhaps you
> should use atexit to free the cache at so unload ??

That may work, I will add it to the list of thinsg to look at.

FWIW, adding


to the driver entry in odbcinst.ini should help the leak.

Nick Gorham
Easysoft Limited

More information about the unixODBC-dev mailing list