fix free before use
This commit is contained in:
parent
11e80e2611
commit
a551bfcafc
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue