From 1a190182ea657127fdf05eff892546087046da97 Mon Sep 17 00:00:00 2001
From: Lynx Linden <lynx@lindenlab.com>
Date: Mon, 14 Jun 2010 16:02:55 +0100
Subject: 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.
---
 indra/llimage/llimagepng.cpp | 1 +
 1 file changed, 1 insertion(+)

(limited to 'indra')

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;
 	}
 
-- 
cgit v1.2.3