summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2010-06-14 16:02:55 +0100
committerLynx Linden <lynx@lindenlab.com>2010-06-14 16:02:55 +0100
commit1a190182ea657127fdf05eff892546087046da97 (patch)
tree31456da50c05e9575750e12722e2150a7673da2a
parente79b9d9bab9c18c05cccbff1ae5869377b303560 (diff)
EXT-7851 FIXED Memory leak in LLImagePNG::encode()
We were not freeing the temporary image buffer if the PNG encoding failed. This probably doesn't happen very often, but it's good to plug the leak all the same.
-rw-r--r--indra/llimage/llimagepng.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/indra/llimage/llimagepng.cpp b/indra/llimage/llimagepng.cpp
index b5de104e61..a6ab246a2c 100644
--- a/indra/llimage/llimagepng.cpp
+++ b/indra/llimage/llimagepng.cpp
@@ -135,6 +135,7 @@ BOOL LLImagePNG::encode(const LLImageRaw* raw_image, F32 encode_time)
if (! pngWrapper.writePng(raw_image, mTmpWriteBuffer))
{
setLastError(pngWrapper.getErrorMessage());
+ delete[] mTmpWriteBuffer;
return FALSE;
}