Fix uninitialized variable in case append_buffer fails with out of memory due to buffer copy allocation
git-svn-id: http://pugixml.googlecode.com/svn/trunk@941 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
7b61ad6379
commit
30549910db
1 changed files with 3 additions and 1 deletions
|
@ -4558,12 +4558,14 @@ namespace pugi
|
|||
_root->name = 0;
|
||||
|
||||
// parse
|
||||
xml_parse_result res = impl::load_buffer_impl(doc, _root, const_cast<void*>(contents), size, options, encoding, false, false, &extra->buffer);
|
||||
char_t* buffer = 0;
|
||||
xml_parse_result res = impl::load_buffer_impl(doc, _root, const_cast<void*>(contents), size, options, encoding, false, false, &buffer);
|
||||
|
||||
// restore name
|
||||
_root->name = rootname;
|
||||
|
||||
// add extra buffer to the list
|
||||
extra->buffer = buffer;
|
||||
extra->next = doc->extra_buffers;
|
||||
doc->extra_buffers = extra;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue