fix free before use

This commit is contained in:
Bill Hoffman 2002-12-05 16:52:55 -05:00
parent 11e80e2611
commit a551bfcafc
1 changed files with 3 additions and 2 deletions

View File

@ -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;
} }