mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-07-04 13:46:54 -04:00
a potential double free fix .
This commit is contained in:
parent
2a9edd868c
commit
1672fd8901
1 changed files with 4 additions and 4 deletions
|
@ -1934,11 +1934,11 @@ void CLoading::SetImageData(unsigned char* pBuffer, const CString& NameInDict, i
|
|||
|
||||
void CLoading::SetImageData(unsigned char* pBuffer, PICDATA& pData, const int FullWidth, const int FullHeight, Palette* pPal, bool forceNoRemap)
|
||||
{
|
||||
if (pData.pic) {
|
||||
delete[](pData.pic);
|
||||
if (auto pPic = std::exchange(pData.pic, nullptr)) {
|
||||
delete[](pPic);
|
||||
}
|
||||
if (pData.vborder) {
|
||||
delete[](pData.vborder);
|
||||
if (auto pBorder = std::exchange(pData.vborder, nullptr)) {
|
||||
delete[](pBorder);
|
||||
}
|
||||
|
||||
// Get available area
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue