List:Commits« Previous MessageNext Message »
From:bdegtyariov Date:December 8 2005 6:18pm
Subject:Connector/ODBC 3.51 commit: r29 - myodbc3u
View as plain text  
Modified:
   myodbc3u/MYODBCUtilReadConnectStr.c
Log:
Fixed a memory leak when use SQLDriverConnect function with the connection string that has
empty parameter values like UID=root;PWD=;SERVER=...

Modified: myodbc3u/MYODBCUtilReadConnectStr.c
===================================================================
--- myodbc3u/MYODBCUtilReadConnectStr.c	2005-11-21 23:27:40 UTC (rev 28)
+++ myodbc3u/MYODBCUtilReadConnectStr.c	2005-12-08 18:18:47 UTC (rev 29)
@@ -61,6 +61,9 @@
                 {
                     if ( (!isalpha( *pScanChar ) && !isdigit( *pScanChar )
&& *pScanChar != '}') || *pScanChar == '=' )
                     {
+                        // To prevent a memory leak when use such connection strings
UID=root;PWD=;SERVER=localhost;...
+                        if( pszName )
+                            free( pszName );
                         pszName = (char *)strndup( pAnchorChar, pScanChar - pAnchorChar
);
 
                         if ( *pScanChar == '=' )

Thread
Connector/ODBC 3.51 commit: r29 - myodbc3ubdegtyariov8 Dec