summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsdserialize.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llsdserialize.cpp')
-rw-r--r--indra/llcommon/llsdserialize.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 3a219eb998..ede212181d 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -2144,7 +2144,11 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
const U32 CHUNK = 65536;
- U8 *in = new U8[size];
+ U8 *in = new(std::nothrow) U8[size];
+ if (!in)
+ {
+ return false;
+ }
is.read((char*) in, size);
U8 out[CHUNK];
@@ -2188,7 +2192,6 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
U8* new_result = (U8*)realloc(result, cur_size + have);
if (new_result == NULL)
{
- LL_WARNS() << "Failed to unzip LLSD block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL;
inflateEnd(&strm);
if (result)
{