MAINT-8028 Fixed memory leak in allocateDataSize()

meow-7.2.2
andreykproductengine 2017-11-27 15:02:33 +02:00
parent 6d7c19623d
commit e5ef898728
1 changed files with 6 additions and 1 deletions

View File

@ -748,7 +748,11 @@ U8* LLImageBase::allocateData(S32 size)
{
size = 0;
mWidth = mHeight = 0;
mData = NULL;
if (mData)
{
deleteData(); // virtual
mData = NULL;
}
}
mDataSize = size;
claimMem(mDataSize);
@ -775,6 +779,7 @@ U8* LLImageBase::reallocateData(S32 size)
disclaimMem(mDataSize);
mDataSize = size;
claimMem(mDataSize);
mBadBufferAllocation = false;
return mData;
}