commit | 074180119fc90d5fd04ef9e8a5ee1910d6f9ad8e | [log] [tgz] |
---|---|---|
author | David Tardon <dtardon@redhat.com> | Wed Apr 05 10:22:40 2017 +0200 |
committer | Daniel Veillard <veillard@redhat.com> | Fri Apr 07 18:24:52 2017 +0200 |
tree | 8a04a7a3d291649360636e2df16c9fb354d2be46 | |
parent | 90ccb58242866b0ba3edbef8fe44214a101c2b3e [diff] |
Do not leak the new CData node if adding fails For https://bugzilla.gnome.org/show_bug.cgi?id=780918
diff --git a/SAX2.c b/SAX2.c index 5cbb700..0f0ad2a 100644 --- a/SAX2.c +++ b/SAX2.c
@@ -2805,7 +2805,8 @@ xmlTextConcat(lastChild, value, len); } else { ret = xmlNewCDataBlock(ctxt->myDoc, value, len); - xmlAddChild(ctxt->node, ret); + if (xmlAddChild(ctxt->node, ret) == NULL) + xmlFreeNode(ret); } }