aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt3
-rw-r--r--linden/indra/llmessage/llhttpclient.cpp14
2 files changed, 9 insertions, 8 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index b896e56..1cefb08 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -8,6 +8,9 @@
8 * linden/indra/newview/llviewermessage.cpp: 8 * linden/indra/newview/llviewermessage.cpp:
9 Ditto. 9 Ditto.
10 10
11 * linden/indra/llmessage/llhttpclient.cpp:
12 Applied memleak patch from VWR-9400 by Henri and Carjay.
13
11 14
122009-03-01 McCabe Maxsted <hakushakukun@gmail.com> 152009-03-01 McCabe Maxsted <hakushakukun@gmail.com>
13 16
diff --git a/linden/indra/llmessage/llhttpclient.cpp b/linden/indra/llmessage/llhttpclient.cpp
index a07f379..8a4b063 100644
--- a/linden/indra/llmessage/llhttpclient.cpp
+++ b/linden/indra/llmessage/llhttpclient.cpp
@@ -160,10 +160,9 @@ namespace
160 fstream.seekg(0, std::ios::end); 160 fstream.seekg(0, std::ios::end);
161 U32 fileSize = fstream.tellg(); 161 U32 fileSize = fstream.tellg();
162 fstream.seekg(0, std::ios::beg); 162 fstream.seekg(0, std::ios::beg);
163 char* fileBuffer; 163 std::vector<char> fileBuffer(fileSize);
164 fileBuffer = new char [fileSize]; 164 fstream.read(&fileBuffer[0], fileSize);
165 fstream.read(fileBuffer, fileSize); 165 ostream.write(&fileBuffer[0], fileSize);
166 ostream.write(fileBuffer, fileSize);
167 fstream.close(); 166 fstream.close();
168 eos = true; 167 eos = true;
169 return STATUS_DONE; 168 return STATUS_DONE;
@@ -190,10 +189,9 @@ namespace
190 189
191 LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ); 190 LLVFile vfile(gVFS, mUUID, mAssetType, LLVFile::READ);
192 S32 fileSize = vfile.getSize(); 191 S32 fileSize = vfile.getSize();
193 U8* fileBuffer; 192 std::vector<U8> fileBuffer(fileSize);
194 fileBuffer = new U8 [fileSize]; 193 vfile.read(&fileBuffer[0], fileSize);
195 vfile.read(fileBuffer, fileSize); 194 ostream.write((char*)&fileBuffer[0], fileSize);
196 ostream.write((char*)fileBuffer, fileSize);
197 eos = true; 195 eos = true;
198 return STATUS_DONE; 196 return STATUS_DONE;
199 } 197 }