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
@ -4558,12 +4558,14 @@ namespace pugi
|
|||||||
_root->name = 0;
|
_root->name = 0;
|
||||||
|
|
||||||
// parse
|
// 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
|
// restore name
|
||||||
_root->name = rootname;
|
_root->name = rootname;
|
||||||
|
|
||||||
// add extra buffer to the list
|
// add extra buffer to the list
|
||||||
|
extra->buffer = buffer;
|
||||||
extra->next = doc->extra_buffers;
|
extra->next = doc->extra_buffers;
|
||||||
doc->extra_buffers = extra;
|
doc->extra_buffers = extra;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user