Index: setup/ConfigDSN.c =================================================================== --- setup/ConfigDSN.c (revision 554) +++ setup/ConfigDSN.c (working copy) @@ -83,7 +83,7 @@ goto exitConfigDSN; } - pDataSource->pszDRIVER = (char *)strdup( pszDriver ); + pDataSource->pszDRIVER = (char *)_global_strdup( pszDriver ); switch ( nRequest ) { Index: setup/MYODBCSetupDataSourceConfig.cpp =================================================================== --- setup/MYODBCSetupDataSourceConfig.cpp (revision 554) +++ setup/MYODBCSetupDataSourceConfig.cpp (working copy) @@ -63,7 +63,7 @@ { int argc = 1; char * argv[] = { pszAppName, NULL }; - static QApplication app( argc, argv ); + QApplication app( argc, argv ); // MYODBCSetupDataSourceDialog *pdialogDataSource = new MYODBCSetupDataSourceDialog( 0, pDataSource ); // Index: setup/MYODBCSetupDataSourceDialog.cpp =================================================================== --- setup/MYODBCSetupDataSourceDialog.cpp (revision 554) +++ setup/MYODBCSetupDataSourceDialog.cpp (working copy) @@ -269,7 +269,7 @@ if ( nFlags > 0 ) { - pDataSource->pszOPTION = (char*)malloc( 50 ); + pDataSource->pszOPTION = (char*)_global_alloc(50); sprintf( pDataSource->pszOPTION, "%d", nFlags ); } } Index: util/MYODBCUtil.h =================================================================== --- util/MYODBCUtil.h (revision 554) +++ util/MYODBCUtil.h (working copy) @@ -230,6 +230,7 @@ char *strnglobaldup( const char *s, size_t n); # define _global_strdup(s) strglobaldup(s) # define _global_strndup(s, n) strnglobaldup(s, n) +# define _global_alloc(n) GlobalAlloc(GMEM_FIXED, (n)) # define _global_free(p) GlobalFree(p) #else # define _global_strdup(s) strdup(s) @@ -240,6 +241,7 @@ char *myodbc_strndup( const char *s, size_t n ); # define _global_strndup(s, n) myodbc_strndup(s, n) # endif +# define _global_alloc malloc # define _global_free(p) free(p) #endif Index: util/MYODBCUtilClearDataSource.c =================================================================== --- util/MYODBCUtilClearDataSource.c (revision 554) +++ util/MYODBCUtilClearDataSource.c (working copy) @@ -51,7 +51,7 @@ if ( pDataSource->pszOPTION ) { _global_free( pDataSource->pszOPTION ); - pDataSource->pszDSN = NULL; + pDataSource->pszOPTION = NULL; } if ( pDataSource->pszPASSWORD ) { Index: util/MYODBCUtilReadDataSource.c =================================================================== --- util/MYODBCUtilReadDataSource.c (revision 554) +++ util/MYODBCUtilReadDataSource.c (working copy) @@ -302,7 +302,7 @@ Some people have reported that the friendly driver name is never found so... */ if ( !pDataSource->pszDRIVER ) - pDataSource->pszDRIVER = MYODBCINST_DRIVER_NAME; + pDataSource->pszDRIVER = _global_strdup(MYODBCINST_DRIVER_NAME); #endif #if defined(WIN32)