From 6718a49a75c861336d272082b1af46b5910f89ad Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Dec 2008 11:53:58 -0600 Subject: VWR-9400 (memleak whenever an LSL script is uploaded) Patch by Carjay McGinnis. --- ChangeLog.txt | 5 +++++ linden/indra/llmessage/llhttpclient.cpp | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 533bddd..f9baad6 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,10 @@ 2008-12-06 Jacek Antonelli + * linden/indra/llmessage/llhttpclient.cpp: + VWR-9400 (memleak whenever an LSL script is uploaded) + Patch by Carjay McGinnis. + + * linden/indra/llimage/llimagetga.cpp: VWR-10837 (use delete [] in LLImageTGA) Patch by Aleric Inglewood. diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp index fc2612f..6242bda 100644 --- a/linden/indra/llmessage/llhttpclient.cpp +++ b/linden/indra/llmessage/llhttpclient.cpp @@ -160,10 +160,9 @@ namespace fstream.seekg(0, std::ios::end); U32 fileSize = fstream.tellg(); fstream.seekg(0, std::ios::beg); - char* fileBuffer; - fileBuffer = new char [fileSize]; - fstream.read(fileBuffer, fileSize); - ostream.write(fileBuffer, fileSize); + std::vector fileBuffer(fileSize); + fstream.read(&fileBuffer[0], fileSize); + ostream.write(&fileBuffer[0], fileSize); fstream.close(); eos = true; return STATUS_DONE; -- cgit v1.1