List:Commits« Previous MessageNext Message »
From:Georg Richter Date:September 27 2010 11:12am
Subject:bzr commit into libmysql branch (georg.richter:2910)
View as plain text  
#At file:///home/georg/work/mysql/connectors/connector-c/ based on revid:georg.richter@stripped

 2910 Georg Richter	2010-09-27
      Fix for previous push

    modified:
      libmysql/plugin.c
=== modified file 'libmysql/plugin.c'
--- a/libmysql/plugin.c	2010-09-27 09:21:43 +0000
+++ b/libmysql/plugin.c	2010-09-27 11:12:35 +0000
@@ -341,7 +341,7 @@ STDCALL mysql_load_client_plugin_v(MYSQL
 {
   char *errormsg;
 #ifdef WIN32
-  my_bool dl_error= 0;
+  char win_errormsg[2048];
 #endif
   void *dl= NULL;
   struct st_mysql_client_plugin *plugin;
@@ -374,9 +374,9 @@ STDCALL mysql_load_client_plugin_v(MYSQL
   if(!(dl= dlopen(dlpath, RTLD_NOW)))
   {
 #ifdef WIN32
-    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM & FORMAT_MESSAGE_ALLOCATE_BUFFER,
-                  0, GetLastError(), 0, errormsg, 0, NULL);
-    dl_error= 1;
+    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
+                  0, GetLastError(), 0, win_errormsg, 2048, NULL);
+    errormsg= win_errormsg;
 #else
     errormsg= dlerror();
 #endif
@@ -400,11 +400,6 @@ error:
   pthread_mutex_unlock(&LOCK_load_client_plugin);
   set_mysql_extended_error(mysql, CR_PLUGIN_CANNOT_LOAD, unknown_sqlstate,
                            ER(CR_PLUGIN_CANNOT_LOAD), plugin_name, errormsg);
-#ifdef WIN32
-  /* free memory allocated by FormatMessage */
-  if (dl_error)
-    LocalFree(errormsg);
-#endif
   DBUG_RETURN(NULL);
 }
 


Attachment: [text/bzr-bundle] bzr/georg.richter@sun.com-20100927111235-ti0cvmvzqlh218cf.bundle
Thread
bzr commit into libmysql branch (georg.richter:2910) Georg Richter27 Sep