Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Archive
Alchemy Viewer
Commits
7cc9455f
Commit
7cc9455f
authored
7 years ago
by
AndreyL ProductEngine
Browse files
Options
Downloads
Patches
Plain Diff
MAINT-6697 Correct pointer freeing
parent
d9fe21f1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/llcommon/llsdserialize.cpp
+21
-6
21 additions, 6 deletions
indra/llcommon/llsdserialize.cpp
with
21 additions
and
6 deletions
indra/llcommon/llsdserialize.cpp
+
21
−
6
View file @
7cc9455f
...
@@ -2091,13 +2091,18 @@ std::string zip_llsd(LLSD& data)
...
@@ -2091,13 +2091,18 @@ std::string zip_llsd(LLSD& data)
}
}
have
=
CHUNK
-
strm
.
avail_out
;
have
=
CHUNK
-
strm
.
avail_out
;
output
=
(
U8
*
)
realloc
(
output
,
cur_size
+
have
);
U8
*
new_
output
=
(
U8
*
)
realloc
(
output
,
cur_size
+
have
);
if
(
output
==
NULL
)
if
(
new_
output
==
NULL
)
{
{
LL_WARNS
()
<<
"Failed to compress LLSD block: can't reallocate memory, current size: "
<<
cur_size
<<
" bytes; requested "
<<
cur_size
+
have
<<
" bytes."
<<
LL_ENDL
;
LL_WARNS
()
<<
"Failed to compress LLSD block: can't reallocate memory, current size: "
<<
cur_size
<<
" bytes; requested "
<<
cur_size
+
have
<<
" bytes."
<<
LL_ENDL
;
deflateEnd
(
&
strm
);
deflateEnd
(
&
strm
);
if
(
output
)
{
free
(
output
);
}
return
std
::
string
();
return
std
::
string
();
}
}
output
=
new_output
;
memcpy
(
output
+
cur_size
,
out
,
have
);
memcpy
(
output
+
cur_size
,
out
,
have
);
cur_size
+=
have
;
cur_size
+=
have
;
}
}
...
@@ -2180,14 +2185,19 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
...
@@ -2180,14 +2185,19 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)
U32
have
=
CHUNK
-
strm
.
avail_out
;
U32
have
=
CHUNK
-
strm
.
avail_out
;
result
=
(
U8
*
)
realloc
(
result
,
cur_size
+
have
);
U8
*
new_
result
=
(
U8
*
)
realloc
(
result
,
cur_size
+
have
);
if
(
result
==
NULL
)
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
;
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
);
inflateEnd
(
&
strm
);
if
(
result
)
{
free
(
result
);
}
delete
[]
in
;
delete
[]
in
;
return
false
;
return
false
;
}
}
result
=
new_result
;
memcpy
(
result
+
cur_size
,
out
,
have
);
memcpy
(
result
+
cur_size
,
out
,
have
);
cur_size
+=
have
;
cur_size
+=
have
;
...
@@ -2279,15 +2289,20 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32
...
@@ -2279,15 +2289,20 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32
U32
have
=
CHUNK
-
strm
.
avail_out
;
U32
have
=
CHUNK
-
strm
.
avail_out
;
result
=
(
U8
*
)
realloc
(
result
,
cur_size
+
have
);
U8
*
new_
result
=
(
U8
*
)
realloc
(
result
,
cur_size
+
have
);
if
(
result
==
NULL
)
if
(
new_
result
==
NULL
)
{
{
LL_WARNS
()
<<
"Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: "
<<
cur_size
<<
" bytes; requested "
<<
cur_size
+
have
<<
" bytes."
<<
LL_ENDL
;
LL_WARNS
()
<<
"Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: "
<<
cur_size
<<
" bytes; requested "
<<
cur_size
+
have
<<
" bytes."
<<
LL_ENDL
;
inflateEnd
(
&
strm
);
inflateEnd
(
&
strm
);
if
(
result
)
{
free
(
result
);
}
delete
[]
in
;
delete
[]
in
;
valid
=
false
;
valid
=
false
;
return
NULL
;
return
NULL
;
}
}
result
=
new_result
;
memcpy
(
result
+
cur_size
,
out
,
have
);
memcpy
(
result
+
cur_size
,
out
,
have
);
cur_size
+=
have
;
cur_size
+=
have
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment