diff options
author | David Tardon <dtardon@redhat.com> | 2017-04-05 10:22:40 +0200 |
---|---|---|
committer | Daniel Veillard <veillard@redhat.com> | 2017-04-07 18:24:52 +0200 |
commit | 074180119fc90d5fd04ef9e8a5ee1910d6f9ad8e (patch) | |
tree | 8a04a7a3d291649360636e2df16c9fb354d2be46 /SAX2.c | |
parent | 90ccb58242866b0ba3edbef8fe44214a101c2b3e (diff) | |
download | libxml2-074180119fc90d5fd04ef9e8a5ee1910d6f9ad8e.tar.gz |
Do not leak the new CData node if adding fails
For https://bugzilla.gnome.org/show_bug.cgi?id=780918
Diffstat (limited to 'SAX2.c')
-rw-r--r-- | SAX2.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2805,7 +2805,8 @@ xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len) xmlTextConcat(lastChild, value, len); } else { ret = xmlNewCDataBlock(ctxt->myDoc, value, len); - xmlAddChild(ctxt->node, ret); + if (xmlAddChild(ctxt->node, ret) == NULL) + xmlFreeNode(ret); } } |