summaryrefslogtreecommitdiff
path: root/indra/newview/llgesturemgr.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
committerAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
commitb01c75cb423f07a3d3354f8bd62f265f80062b3b (patch)
treedec1b220c24a60cc220d1cb07fd3545610644f0a /indra/newview/llgesturemgr.cpp
parent868250bdd74f348557102c0d8408d9bec30331f6 (diff)
svn merge -r117314:117337
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1 QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
Diffstat (limited to 'indra/newview/llgesturemgr.cpp')
-rw-r--r--indra/newview/llgesturemgr.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index 2135ea5315..2dbff92ba0 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -926,20 +926,15 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs,
LLVFile file(vfs, asset_uuid, type, LLVFile::READ);
S32 size = file.getSize();
- char* buffer = new char[size+1];
- if (buffer == NULL)
- {
- llerrs << "Memory Allocation Failed" << llendl;
- return;
- }
+ std::vector<char> buffer(size+1);
- file.read((U8*)buffer, size); /* Flawfinder: ignore */
+ file.read((U8*)&buffer[0], size);
// ensure there's a trailing NULL so strlen will work.
buffer[size] = '\0';
LLMultiGesture* gesture = new LLMultiGesture();
- LLDataPackerAsciiBuffer dp(buffer, size+1);
+ LLDataPackerAsciiBuffer dp(&buffer[0], size+1);
BOOL ok = gesture->deserialize(dp);
if (ok)
@@ -991,9 +986,6 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs,
delete gesture;
gesture = NULL;
}
-
- delete [] buffer;
- buffer = NULL;
}
else
{