mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
fix free before use
This commit is contained in:
@@ -294,10 +294,11 @@ const char* cmDynamicLoader::LastError()
|
||||
);
|
||||
|
||||
// Free the buffer.
|
||||
LocalFree( lpMsgBuf );
|
||||
|
||||
static char* str = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user