Changeset: 0307a2a25eb2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0307a2a25eb2
Modified Files:
        clients/odbc/driver/SQLDisconnect.c
Branch: odbc-tls
Log Message:

When disconnect also free the used connection property strings, so they are not 
visible for a next connection using the same HDBC, which is allowed.


diffs (36 lines):

diff --git a/clients/odbc/driver/SQLDisconnect.c 
b/clients/odbc/driver/SQLDisconnect.c
--- a/clients/odbc/driver/SQLDisconnect.c
+++ b/clients/odbc/driver/SQLDisconnect.c
@@ -63,11 +63,31 @@ SQLDisconnect(SQLHDBC ConnectionHandle)
        mapi_destroy(dbc->mid);
 
        dbc->mid = NULL;
+       dbc->Connected = false;
        dbc->cachelimit = 0;
        dbc->Mdebug = 0;
-       dbc->Connected = false;
        dbc->has_comment = false;
        dbc->raw_strings = false;
+       if (dbc->dsn) {
+               free(dbc->dsn);
+               dbc->dsn = NULL;
+       }
+       if (dbc->uid) {
+               free(dbc->uid);
+               dbc->uid = NULL;
+       }
+       if (dbc->pwd) {
+               free(dbc->pwd);
+               dbc->pwd = NULL;
+       }
+       if (dbc->host) {
+               free(dbc->host);
+               dbc->host = NULL;
+       }
+       if (dbc->dbname) {
+               free(dbc->dbname);
+               dbc->dbname = NULL;
+       }
 
        return SQL_SUCCESS;
 }
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to