فهرست منبع

fix free before use

Bill Hoffman 23 سال پیش
والد
کامیت
a551bfcafc
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 3 2
      Source/cmDynamicLoader.cxx

+ 3 - 2
Source/cmDynamicLoader.cxx

@@ -294,10 +294,11 @@ const char* cmDynamicLoader::LastError()
                 );
                 );
   
   
   // Free the buffer.
   // Free the buffer.
-  LocalFree( lpMsgBuf );
+ 
   static char* str = 0;
   static char* str = 0;
   delete [] str;
   delete [] str;
-  str = strcpy(new char[strlen((char*)lpMsgBuf)+1], (char*)lpMsgBuf);
+  str = strcpy(new char[strlen((char*)lpMsgBuf)+1], (char*)lpMsgBuf); 
+  LocalFree( lpMsgBuf );
   return str;
   return str;
 }
 }