From 8aca337de780b0ed2f90a97df20c84f9b2335c39 Mon Sep 17 00:00:00 2001 From: Iain Denniston Date: Fri, 11 Mar 2011 18:16:28 +0000 Subject: [PATCH] Fix for memory leak --- ChangeLog | 3 +++ ixml/src/element.c | 2 ++ ixml/src/node.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index b790475..30b7dd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ Version 1.6.13 ******************************************************************************* +2011-03-08 Iain Denniston + Fix for memory leak. + 2011-03-08 Iain Denniston Fix and Update of MSVC9 solution and project files - now compile in all modes. Added x64 and static library targets. diff --git a/ixml/src/element.c b/ixml/src/element.c index 7055999..1f59c9e 100644 --- a/ixml/src/element.c +++ b/ixml/src/element.c @@ -272,6 +272,8 @@ int ixmlElement_setAttributeNode( } if (rtAttr != NULL) { *rtAttr = (IXML_Attr *)attrNode; + } else { + ixmlAttr_free((IXML_Attr *)attrNode); } } else { /* Add this attribute */ diff --git a/ixml/src/node.c b/ixml/src/node.c index c9c8dac..c1ab2ce 100644 --- a/ixml/src/node.c +++ b/ixml/src/node.c @@ -588,6 +588,8 @@ int ixmlNode_removeChild( oldChild->parentNode = NULL; if (returnNode != NULL) { *returnNode = oldChild; + } else { + ixmlNode_free(oldChild); } return IXML_SUCCESS;