summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-02 16:28:50 +0000
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-10-02 16:28:50 +0000
commite376ba731fb1531ab836c137d04bbc38abd832b8 (patch)
tree830975ac409ea1d4df85780355326b2a52fe8187
parent59409f70ef52036cecced28d3e7d95f52de9a26a (diff)
Fix copy behavior when out-of-memory
Also remove accidentally committed pragma pack :-/ git-svn-id: https://pugixml.googlecode.com/svn/trunk@1041 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixml.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index 78e5a57..d1dafcb 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -1,4 +1,3 @@
-#pragma pack(push, 16)
/**
* pugixml parser - version 1.4
* --------------------------------------------------------
@@ -3666,13 +3665,16 @@ PUGI__NS_BEGIN
{
xml_node copy(append_new_node(destit.internal_object(), alloc, sourceit.type()));
- node_copy_contents(copy, sourceit, shared_alloc);
-
- if (sourceit.first_child())
+ if (copy)
{
- destit = copy;
- sourceit = sourceit.first_child();
- continue;
+ node_copy_contents(copy, sourceit, shared_alloc);
+
+ if (sourceit.first_child())
+ {
+ destit = copy;
+ sourceit = sourceit.first_child();
+ continue;
+ }
}
}