From 268abf72fb63332a4d6185176f2c334926c36eb8 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Wed, 7 Mar 2012 12:36:45 +0100 Subject: [PATCH] SF Bug Tracker id 3498436 - Memory leak in Parser_processAttributeName Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-07 02:30:57 PST attr is not freed if ixmlNode_setNodeProperties or ixmlNode_setAttributeNode return an error in Parser_processAttributeName. --- ChangeLog | 10 ++++++++++ ixml/src/ixmlparser.c | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6c5c550..0671f01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ Version 1.6.16 ******************************************************************************* +2012-03-07 Fabrice Fontaine + + SF Bug Tracker id 3498436 - Memory leak in Parser_processAttributeName + + Submitted: Fabrice Fontaine ( ffontaine ) - 2012-03-07 02:30:57 PST + + attr is not freed if ixmlNode_setNodeProperties or + ixmlNode_setAttributeNode return an error in + Parser_processAttributeName. + 2012-03-07 Fabrice Fontaine Fixing an error in d6db7c555d0f11856ce5e3e479b16a4cf4689107 commit diff --git a/ixml/src/ixmlparser.c b/ixml/src/ixmlparser.c index 3404a93..54c0bfb 100644 --- a/ixml/src/ixmlparser.c +++ b/ixml/src/ixmlparser.c @@ -2054,11 +2054,15 @@ static int Parser_processAttributeName( rc = ixmlNode_setNodeProperties( ( IXML_Node * ) attr, newNode ); if( rc != IXML_SUCCESS ) { + ixmlAttr_free( attr ); return rc; } rc = ixmlElement_setAttributeNode( (IXML_Element *)xmlParser->currentNodePtr, attr, NULL ); + if( rc != IXML_SUCCESS ) { + ixmlAttr_free( attr ); + } return rc; }