Commit ae2017a9 authored by Michael Karcher's avatar Michael Karcher Committed by Alexandre Julliard

msxml3: Fix leaks in callers of xmlChar_from_wchar.

parent 0803167f
......@@ -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);
}
......
......@@ -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);
}
......
......@@ -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;
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment