valgrind: unoxml leaks like a sieve

This commit is contained in:
Caolán McNamara 2010-12-10 13:01:44 +00:00
parent c1469d226a
commit b84c11696a

View file

@ -209,8 +209,10 @@ namespace DOM
{ {
OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8); OString o1 = OUStringToOString(name, RTL_TEXTENCODING_UTF8);
xmlChar *xValue = xmlGetProp(m_aNodePtr, (xmlChar*)o1.getStr()); xmlChar *xValue = xmlGetProp(m_aNodePtr, (xmlChar*)o1.getStr());
if (xValue != NULL) { if (xValue != NULL)
{
aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8); aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8);
xmlFree(xValue);
} }
} }
return aValue; return aValue;
@ -269,7 +271,8 @@ namespace DOM
OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8); OString o2 = OUStringToOString(namespaceURI, RTL_TEXTENCODING_UTF8);
xmlChar *xNS = (xmlChar*)o2.getStr(); xmlChar *xNS = (xmlChar*)o2.getStr();
xmlChar *xValue = (xmlChar*)xmlGetNsProp(m_aNodePtr, xName, xNS); xmlChar *xValue = (xmlChar*)xmlGetNsProp(m_aNodePtr, xName, xNS);
if (xValue != NULL) { if (xValue != NULL)
{
aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8); aValue = OUString((sal_Char*)xValue, strlen((char*)xValue), RTL_TEXTENCODING_UTF8);
xmlFree(xValue); xmlFree(xValue);
} }
@ -511,6 +514,7 @@ namespace DOM
else else
{ {
oldValue = OUString((char*)xOld, strlen((char*)xOld), RTL_TEXTENCODING_UTF8); oldValue = OUString((char*)xOld, strlen((char*)xOld), RTL_TEXTENCODING_UTF8);
xmlFree(xOld);
xmlSetProp(m_aNodePtr, xName, xValue); xmlSetProp(m_aNodePtr, xName, xValue);
} }
@ -583,6 +587,7 @@ namespace DOM
else else
{ {
oldValue = OUString((char *)xOld, strlen((char *)xOld), RTL_TEXTENCODING_UTF8); oldValue = OUString((char *)xOld, strlen((char *)xOld), RTL_TEXTENCODING_UTF8);
xmlFree(xOld);
xmlSetNsProp(m_aNodePtr, pNs, xLName, xValue); xmlSetNsProp(m_aNodePtr, pNs, xLName, xValue);
} }
// dispatch DOMAttrModified event // dispatch DOMAttrModified event