From 20c9dc0a1da2cd57716796ae97adcd4d018213da Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Dec 2008 12:00:05 -0600 Subject: VWR-9400-patch2 (memleak whenever an LSL script is uploaded) Patch by Henri Beauchamp. --- linden/indra/llmessage/llhttpclient.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'linden/indra/llmessage') diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp index 6242bda..ef163fa 100644 --- a/linden/indra/llmessage/llhttpclient.cpp +++ b/linden/indra/llmessage/llhttpclient.cpp @@ -189,10 +189,9 @@ namespace LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ); S32 fileSize = vfile.getSize(); - U8* fileBuffer; - fileBuffer = new U8 [fileSize]; - vfile.read(fileBuffer, fileSize); - ostream.write((char*)fileBuffer, fileSize); + std::vector fileBuffer(fileSize); + vfile.read(&fileBuffer[0], fileSize); + ostream.write((char*)&fileBuffer[0], fileSize); eos = true; return STATUS_DONE; } -- cgit v1.1