msxml3: Fix leaks in callers of xmlChar_from_wchar.

This commit is contained in:
Michael Karcher 2008-10-11 23:58:35 +02:00 committed by Alexandre Julliard
parent 0803167ff0
commit ae2017a984
4 changed files with 15 additions and 5 deletions

View File

@ -606,6 +606,7 @@ static HRESULT WINAPI domcdata_appendData(
}
else
hr = E_FAIL;
HeapFree(GetProcessHeap(), 0, pContent);
return hr;
}
@ -667,6 +668,7 @@ static HRESULT WINAPI domcdata_insertData(
xmlNodeSetContent(pDOMNode->node, str);
hr = S_OK;
}
HeapFree(GetProcessHeap(), 0, str);
SysFreeString(sNewString);
}

View File

@ -616,6 +616,7 @@ static HRESULT WINAPI domcomment_appendData(
else
hr = E_FAIL;
}
HeapFree( GetProcessHeap(), 0, pContent );
}
else
hr = E_FAIL;
@ -680,6 +681,7 @@ static HRESULT WINAPI domcomment_insertData(
xmlNodeSetContent(pDOMNode->node, str);
hr = S_OK;
}
HeapFree( GetProcessHeap(), 0, str );
SysFreeString(sNewString);
}

View File

@ -372,6 +372,7 @@ static HRESULT WINAPI xmlnode_put_nodeValue(
{
str = xmlChar_from_wchar((WCHAR*)V_BSTR(&string_value));
xmlNodeSetContent(This->node, str);
HeapFree(GetProcessHeap(),0,str);
hr = S_OK;
break;
}
@ -919,7 +920,7 @@ static HRESULT WINAPI xmlnode_put_text(
BSTR text)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
xmlChar *str = NULL;
xmlChar *str, *str2, *str3;
TRACE("%p\n", This);
@ -934,11 +935,13 @@ static HRESULT WINAPI xmlnode_put_text(
str = xmlChar_from_wchar((WCHAR*)text);
/* Escape the string. */
str = xmlEncodeEntitiesReentrant(This->node->doc, str);
str = xmlEncodeSpecialChars(This->node->doc, str);
str2 = xmlEncodeEntitiesReentrant(This->node->doc, str);
HeapFree(GetProcessHeap(), 0, str);
str3 = xmlEncodeSpecialChars(This->node->doc, str2);
xmlFree(str2);
xmlNodeSetContent(This->node, str);
xmlFree(str);
xmlNodeSetContent(This->node, str3);
xmlFree(str3);
return S_OK;
}
@ -1091,6 +1094,7 @@ static HRESULT WINAPI xmlnode_put_dataType(
else
ERR("Failed to Create Namepsace\n");
}
HeapFree( GetProcessHeap(), 0, str );
}
return hr;

View File

@ -603,6 +603,7 @@ static HRESULT WINAPI domtext_appendData(
hr = S_OK;
else
hr = E_FAIL;
HeapFree( GetProcessHeap(), 0, pContent );
}
else
hr = E_FAIL;
@ -667,6 +668,7 @@ static HRESULT WINAPI domtext_insertData(
xmlNodeSetContent(pDOMNode->node, str);
hr = S_OK;
}
HeapFree(GetProcessHeap(), 0, str);
SysFreeString(sNewString);
}