summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2017-11-27 15:02:33 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2017-11-27 15:02:33 +0200
commite5ef898728b5881eb1f233aa4e0dc9dbbd0991a5 (patch)
treeda318c16e3164f487fa1e8a4a02a5ffe844506f4 /indra
parent6d7c19623d44bbd9dcfcd047e3b3ab2120916481 (diff)
MAINT-8028 Fixed memory leak in allocateDataSize()
Diffstat (limited to 'indra')
-rw-r--r--indra/llimage/llimage.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index 04085eb703..0fa0ef79d9 100644
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -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;
}