Commit 73685eb0 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

msxml3: Use CRT allocation functions.

parent 56139179
......@@ -116,7 +116,7 @@ static ULONG WINAPI domattr_Release(
xmlFreeNs( This->node.node->ns );
xmlFreeNode( This->node.node );
}
heap_free( This );
free( This );
}
return ref;
......@@ -731,7 +731,7 @@ IUnknown* create_attribute( xmlNodePtr attribute, BOOL floating )
{
domattr *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -97,7 +97,7 @@ static ULONG WINAPI bsc_Release(
IBinding_Release(bsc->binding);
if (bsc->memstream)
IStream_Release(bsc->memstream);
heap_free(bsc);
free(bsc);
}
return ref;
......@@ -309,7 +309,7 @@ HRESULT bind_url(IMoniker *mon, HRESULT (*onDataAvailable)(void*,char*,DWORD),
if(FAILED(hr))
return hr;
bsc = heap_alloc(sizeof(bsc_t));
bsc = malloc(sizeof(bsc_t));
bsc->IBindStatusCallback_iface.lpVtbl = &bsc_vtbl;
bsc->ref = 1;
......
......@@ -107,7 +107,7 @@ static ULONG WINAPI domcdata_Release(IXMLDOMCDATASection *iface)
if (!ref)
{
destroy_xmlnode(&cdata->node);
heap_free(cdata);
free(cdata);
}
return ref;
......@@ -875,7 +875,7 @@ IUnknown* create_cdata( xmlNodePtr text )
{
domcdata *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -107,7 +107,7 @@ static ULONG WINAPI domcomment_Release(IXMLDOMComment *iface)
if (!ref)
{
destroy_xmlnode(&comment->node);
heap_free(comment);
free(comment);
}
return ref;
......@@ -826,7 +826,7 @@ IUnknown* create_comment( xmlNodePtr comment )
{
domcomment *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -25,7 +25,6 @@
#include "dispex.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "msxml_dispex.h"
......@@ -200,9 +199,9 @@ void release_typelib(void)
for(i=0; i < iter->func_cnt; i++)
SysFreeString(iter->funcs[i].name);
heap_free(iter->funcs);
heap_free(iter->name_table);
heap_free(iter);
free(iter->funcs);
free(iter->name_table);
free(iter);
}
for(i=0; i < ARRAY_SIZE(typeinfos); i++)
......@@ -224,7 +223,7 @@ static void add_func_info(dispex_data_t *data, DWORD *size, tid_t tid, DISPID id
return;
if(data->func_cnt == *size)
data->funcs = heap_realloc(data->funcs, (*size <<= 1)*sizeof(func_info_t));
data->funcs = realloc(data->funcs, (*size <<= 1) * sizeof(func_info_t));
hres = ITypeInfo_GetDocumentation(dti, id, &data->funcs[data->func_cnt].name, NULL, NULL, NULL);
if(FAILED(hres))
......@@ -263,9 +262,9 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
return NULL;
}
data = heap_alloc(sizeof(dispex_data_t));
data = malloc(sizeof(dispex_data_t));
data->func_cnt = 0;
data->funcs = heap_alloc(size*sizeof(func_info_t));
data->funcs = malloc(size * sizeof(func_info_t));
list_add_tail(&dispex_data_list, &data->entry);
while(*tid) {
......@@ -288,16 +287,16 @@ static dispex_data_t *preprocess_dispex_data(DispatchEx *This)
}
if(!data->func_cnt) {
heap_free(data->funcs);
free(data->funcs);
data->funcs = NULL;
}else if(data->func_cnt != size) {
data->funcs = heap_realloc(data->funcs, data->func_cnt * sizeof(func_info_t));
data->funcs = realloc(data->funcs, data->func_cnt * sizeof(func_info_t));
}
if(data->funcs) {
qsort(data->funcs, data->func_cnt, sizeof(func_info_t), dispid_cmp);
data->name_table = heap_alloc(data->func_cnt * sizeof(func_info_t*));
data->name_table = malloc(data->func_cnt * sizeof(func_info_t*));
for(i=0; i < data->func_cnt; i++)
data->name_table[i] = data->funcs+i;
qsort(data->name_table, data->func_cnt, sizeof(func_info_t*), func_name_cmp);
......
......@@ -106,7 +106,7 @@ static ULONG WINAPI domfrag_Release(IXMLDOMDocumentFragment *iface)
if (!ref)
{
destroy_xmlnode(&domfrag->node);
heap_free(domfrag);
free(domfrag);
}
return ref;
......@@ -581,7 +581,7 @@ IUnknown* create_doc_fragment( xmlNodePtr fragment )
{
domfrag *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -98,7 +98,7 @@ static ULONG WINAPI domdoctype_Release(IXMLDOMDocumentType *iface)
if (!ref)
{
destroy_xmlnode(&doctype->node);
heap_free(doctype);
free(doctype);
}
return ref;
......@@ -570,7 +570,7 @@ IUnknown* create_doc_type( xmlNodePtr doctype )
{
domdoctype *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -262,7 +262,7 @@ static inline void clear_selectNsList(struct list* pNsList)
select_ns_entry *ns, *ns2;
LIST_FOR_EACH_ENTRY_SAFE( ns, ns2, pNsList, select_ns_entry, entry )
{
heap_free( ns );
free(ns);
}
list_init(pNsList);
}
......@@ -270,7 +270,7 @@ static inline void clear_selectNsList(struct list* pNsList)
static xmldoc_priv * create_priv(void)
{
xmldoc_priv *priv;
priv = heap_alloc( sizeof (*priv) );
priv = malloc(sizeof(*priv));
if (priv)
{
......@@ -284,14 +284,14 @@ static xmldoc_priv * create_priv(void)
static domdoc_properties *create_properties(MSXML_VERSION version)
{
domdoc_properties *properties = heap_alloc(sizeof(domdoc_properties));
domdoc_properties *properties = malloc(sizeof(domdoc_properties));
properties->refs = 1;
list_init(&properties->selectNsList);
properties->preserving = VARIANT_FALSE;
properties->validating = VARIANT_TRUE;
properties->schemaCache = NULL;
properties->selectNsStr = heap_alloc_zero(sizeof(xmlChar));
properties->selectNsStr = calloc(1, sizeof(xmlChar));
properties->selectNsStr_len = 0;
/* properties that are dependent on object versions */
......@@ -306,7 +306,7 @@ static domdoc_properties *create_properties(MSXML_VERSION version)
static domdoc_properties* copy_properties(domdoc_properties const* properties)
{
domdoc_properties* pcopy = heap_alloc(sizeof(domdoc_properties));
domdoc_properties* pcopy = malloc(sizeof(domdoc_properties));
select_ns_entry const* ns = NULL;
select_ns_entry* new_ns = NULL;
int len = (properties->selectNsStr_len+1)*sizeof(xmlChar);
......@@ -324,13 +324,13 @@ static domdoc_properties* copy_properties(domdoc_properties const* properties)
pcopy->XPath = properties->XPath;
pcopy->selectNsStr_len = properties->selectNsStr_len;
list_init( &pcopy->selectNsList );
pcopy->selectNsStr = heap_alloc(len);
pcopy->selectNsStr = malloc(len);
memcpy((xmlChar*)pcopy->selectNsStr, properties->selectNsStr, len);
offset = pcopy->selectNsStr - properties->selectNsStr;
LIST_FOR_EACH_ENTRY( ns, (&properties->selectNsList), select_ns_entry, entry )
{
new_ns = heap_alloc(sizeof(select_ns_entry));
new_ns = malloc(sizeof(select_ns_entry));
memcpy(new_ns, ns, sizeof(select_ns_entry));
new_ns->href += offset;
new_ns->prefix += offset;
......@@ -374,10 +374,10 @@ static void properties_release(domdoc_properties *properties)
if (properties->schemaCache)
IXMLDOMSchemaCollection2_Release(properties->schemaCache);
clear_selectNsList(&properties->selectNsList);
heap_free((xmlChar*)properties->selectNsStr);
free((xmlChar*)properties->selectNsStr);
if (properties->uri)
IUri_Release(properties->uri);
heap_free(properties);
free(properties);
}
}
......@@ -643,10 +643,10 @@ LONG xmldoc_release_refs(xmlDocPtr doc, LONG refs)
LIST_FOR_EACH_ENTRY_SAFE( orphan, orphan2, &priv->orphans, orphan_entry, entry )
{
xmlFreeNode( orphan->node );
heap_free( orphan );
free( orphan );
}
properties_release(priv->properties);
heap_free(doc->_private);
free(doc->_private);
xmlFreeDoc(doc);
}
......@@ -664,7 +664,7 @@ HRESULT xmldoc_add_orphan(xmlDocPtr doc, xmlNodePtr node)
xmldoc_priv *priv = priv_from_xmlDocPtr(doc);
orphan_entry *entry;
entry = heap_alloc( sizeof (*entry) );
entry = malloc(sizeof(*entry));
if(!entry)
return E_OUTOFMEMORY;
......@@ -683,7 +683,7 @@ HRESULT xmldoc_remove_orphan(xmlDocPtr doc, xmlNodePtr node)
if( entry->node == node )
{
list_remove( &entry->entry );
heap_free( entry );
free( entry );
return S_OK;
}
}
......@@ -1009,7 +1009,7 @@ static ULONG WINAPI domdoc_Release( IXMLDOMDocument3 *iface )
properties_release(This->properties);
release_namespaces(This);
heap_free(This);
free(This);
}
return ref;
......@@ -2148,7 +2148,7 @@ static HRESULT WINAPI domdoc_createNode(
case NODE_DOCUMENT_TYPE:
case NODE_ENTITY:
case NODE_NOTATION:
heap_free(xml_name);
free(xml_name);
return E_INVALIDARG;
default:
FIXME("unhandled node type %d\n", node_type);
......@@ -2157,8 +2157,8 @@ static HRESULT WINAPI domdoc_createNode(
}
*node = create_node(xmlnode);
heap_free(xml_name);
heap_free(href);
free(xml_name);
free(href);
if(*node)
{
......@@ -2607,7 +2607,7 @@ static char *xmldoc_encoding(IXMLDOMDocument3 *doc)
IXMLDOMNode_Release(node);
}
if (!encoding && (encoding = heap_alloc(sizeof("UTF-8"))))
if (!encoding && (encoding = malloc(sizeof("UTF-8"))))
strcpy(encoding, "UTF-8");
return encoding;
......@@ -2656,7 +2656,7 @@ static HRESULT WINAPI domdoc_save(
TRACE("using encoding %s\n", encoding ? debugstr_a(encoding) : "default");
ctx = xmlSaveToIO(domdoc_stream_save_writecallback,
domdoc_stream_save_closecallback, stream, encoding, XML_SAVE_NO_DECL);
heap_free(encoding);
free(encoding);
if(!ctx)
{
......@@ -2684,7 +2684,7 @@ static HRESULT WINAPI domdoc_save(
TRACE("using encoding %s\n", encoding ? debugstr_a(encoding) : "default");
ctx = xmlSaveToIO(domdoc_save_writecallback, domdoc_save_closecallback,
handle, encoding, XML_SAVE_NO_DECL);
heap_free(encoding);
free(encoding);
if (!ctx)
{
......@@ -3080,7 +3080,7 @@ static HRESULT WINAPI domdoc_setProperty(
pNsList = &(This->properties->selectNsList);
clear_selectNsList(pNsList);
heap_free(nsStr);
free(nsStr);
nsStr = xmlchar_from_wchar(bstr);
TRACE("property value: \"%s\"\n", debugstr_w(bstr));
......@@ -3106,7 +3106,7 @@ static HRESULT WINAPI domdoc_setProperty(
if (ns_entry)
memset(ns_entry, 0, sizeof(select_ns_entry));
else
ns_entry = heap_alloc_zero(sizeof(select_ns_entry));
ns_entry = calloc(1, sizeof(select_ns_entry));
while (*pTokBegin == ' ')
++pTokBegin;
......@@ -3183,7 +3183,7 @@ static HRESULT WINAPI domdoc_setProperty(
continue;
}
}
heap_free(ns_entry);
free(ns_entry);
xmlXPathFreeContext(ctx);
}
......@@ -3249,7 +3249,7 @@ static HRESULT WINAPI domdoc_getProperty(
pNsList = &This->properties->selectNsList;
lenA = This->properties->selectNsStr_len;
lenW = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)nsStr, lenA+1, NULL, 0);
rebuiltStr = heap_alloc(lenW*sizeof(WCHAR));
rebuiltStr = malloc(lenW * sizeof(WCHAR));
MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)nsStr, lenA+1, rebuiltStr, lenW);
cur = rebuiltStr;
/* this is fine because all of the chars that end tokens are ASCII*/
......@@ -3268,7 +3268,7 @@ static HRESULT WINAPI domdoc_getProperty(
}
}
V_BSTR(var) = SysAllocString(rebuiltStr);
heap_free(rebuiltStr);
free(rebuiltStr);
return S_OK;
}
else if (lstrcmpiW(p, PropertyValidateOnParse) == 0)
......@@ -3537,11 +3537,11 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
break;
if (i == This->sinks_size)
This->sinks = heap_realloc(This->sinks,(++This->sinks_size)*sizeof(*This->sinks));
This->sinks = realloc(This->sinks, (++This->sinks_size) * sizeof(*This->sinks));
}
else
{
This->sinks = heap_alloc(sizeof(*This->sinks));
This->sinks = malloc(sizeof(*This->sinks));
This->sinks_size = 1;
i = 0;
}
......@@ -3753,7 +3753,7 @@ HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document)
{
domdoc *doc;
doc = heap_alloc( sizeof (*doc) );
doc = malloc(sizeof(*doc));
if( !doc )
return E_OUTOFMEMORY;
......@@ -3805,7 +3805,7 @@ HRESULT dom_document_create(MSXML_VERSION version, void **ppObj)
if(FAILED(hr))
{
properties_release(properties_from_xmlDocPtr(xmldoc));
heap_free(xmldoc->_private);
free(xmldoc->_private);
xmlFreeDoc(xmldoc);
return hr;
}
......
......@@ -92,7 +92,7 @@ static ULONG WINAPI domimpl_Release(IXMLDOMImplementation *iface)
TRACE("%p, refcount %lu.\n", iface, ref);
if (!ref)
heap_free(domimpl);
free(domimpl);
return ref;
}
......@@ -194,7 +194,7 @@ HRESULT create_dom_implementation(IXMLDOMImplementation **ret)
{
domimpl *object;
if (!(object = heap_alloc(sizeof(*object))))
if (!(object = malloc(sizeof(*object))))
return E_OUTOFMEMORY;
object->IXMLDOMImplementation_iface.lpVtbl = &domimpl_vtbl;
......
......@@ -120,7 +120,7 @@ static ULONG WINAPI domelem_Release(IXMLDOMElement *iface)
if (!ref)
{
destroy_xmlnode(&element->node);
heap_free(element);
free(element);
}
return ref;
......@@ -1249,7 +1249,7 @@ static HRESULT WINAPI domelem_getAttribute(
xml_value = xmlGetNsProp(element, xml_name, NULL);
}
heap_free(xml_name);
free(xml_name);
if(xml_value)
{
V_VT(value) = VT_BSTR;
......@@ -1311,8 +1311,8 @@ static HRESULT WINAPI domelem_setAttribute(
if (ns)
{
int cmp = xmlStrEqual(ns->href, xml_value);
heap_free(xml_value);
heap_free(xml_name);
free(xml_value);
free(xml_name);
return cmp ? S_OK : E_INVALIDARG;
}
}
......@@ -1320,8 +1320,8 @@ static HRESULT WINAPI domelem_setAttribute(
if (!xmlSetNsProp(element, NULL, xml_name, xml_value))
hr = E_FAIL;
heap_free(xml_value);
heap_free(xml_name);
free(xml_value);
free(xml_name);
return hr;
}
......@@ -1365,13 +1365,13 @@ static HRESULT WINAPI domelem_getAttributeNode(
nameA = xmlchar_from_wchar(p);
if (!xmlValidateNameValue(nameA))
{
heap_free(nameA);
free(nameA);
return E_FAIL;
}
if (!attributeNode)
{
heap_free(nameA);
free(nameA);
return S_FALSE;
}
......@@ -1396,7 +1396,7 @@ static HRESULT WINAPI domelem_getAttributeNode(
if (attr && attr->ns) attr = NULL;
}
heap_free(nameA);
free(nameA);
if (attr)
{
......@@ -1470,8 +1470,8 @@ static HRESULT WINAPI domelem_setAttributeNode(
{
SysFreeString(nameW);
VariantClear(&valueW);
heap_free(name);
heap_free(value);
free(name);
free(value);
return E_OUTOFMEMORY;
}
......@@ -1481,8 +1481,8 @@ static HRESULT WINAPI domelem_setAttributeNode(
SysFreeString(nameW);
VariantClear(&valueW);
heap_free(name);
heap_free(value);
free(name);
free(value);
return attr ? S_OK : E_FAIL;
}
......@@ -1606,14 +1606,14 @@ static HRESULT domelem_get_qualified_item(const xmlNodePtr node, BSTR name, BSTR
nameA = xmlchar_from_wchar(name);
if (!nameA)
{
heap_free(href);
free(href);
return E_OUTOFMEMORY;
}
attr = xmlHasNsProp(node, nameA, href);
heap_free(nameA);
heap_free(href);
free(nameA);
free(href);
if (!attr)
{
......@@ -1637,7 +1637,7 @@ static HRESULT domelem_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMN
nameA = xmlchar_from_wchar(name);
local = xmlSplitQName2(nameA, &prefix);
heap_free(nameA);
free(nameA);
if (!local)
return domelem_get_qualified_item(node, name, NULL, item);
......@@ -1718,14 +1718,14 @@ static HRESULT domelem_remove_qualified_item(xmlNodePtr node, BSTR name, BSTR ur
nameA = xmlchar_from_wchar(name);
if (!nameA)
{
heap_free(href);
free(href);
return E_OUTOFMEMORY;
}
attr = xmlHasNsProp(node, nameA, href);
heap_free(nameA);
heap_free(href);
free(nameA);
free(href);
if (!attr)
{
......@@ -1759,7 +1759,7 @@ static HRESULT domelem_remove_named_item(xmlNodePtr node, BSTR name, IXMLDOMNode
nameA = xmlchar_from_wchar(name);
local = xmlSplitQName2(nameA, &prefix);
heap_free(nameA);
free(nameA);
if (!local)
return domelem_remove_qualified_item(node, name, NULL, item);
......@@ -1937,7 +1937,7 @@ IUnknown* create_element( xmlNodePtr element )
{
domelem *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof *This);
if ( !This )
return NULL;
......
......@@ -108,7 +108,7 @@ static ULONG WINAPI entityref_Release(
if (!ref)
{
destroy_xmlnode(&This->node);
heap_free( This );
free(This);
}
return ref;
......@@ -578,7 +578,7 @@ IUnknown* create_doc_entity_ref( xmlNodePtr entity )
{
entityref *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -209,7 +209,7 @@ static ULONG WINAPI DOMClassFactory_Release(IClassFactory *iface )
TRACE("%p, refcount %lu.\n", iface, ref);
if (!ref)
heap_free(factory);
free(factory);
return ref;
}
......@@ -260,7 +260,7 @@ static const struct IClassFactoryVtbl DOMClassFactoryVtbl =
static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv, DOMFactoryCreateInstanceFunc fnCreateInstance)
{
DOMFactory *ret = heap_alloc(sizeof(DOMFactory));
DOMFactory *ret = malloc(sizeof(DOMFactory));
HRESULT hres;
ret->IClassFactory_iface.lpVtbl = &DOMClassFactoryVtbl;
......@@ -270,7 +270,7 @@ static HRESULT DOMClassFactory_Create(const GUID *clsid, REFIID riid, void **ppv
hres = IClassFactory_QueryInterface(&ret->IClassFactory_iface, riid, ppv);
if(FAILED(hres)) {
heap_free(ret);
free(ret);
*ppv = NULL;
}
return hres;
......
......@@ -164,7 +164,7 @@ static void free_response_headers(httprequest *This)
list_remove(&header->entry);
SysFreeString(header->header);
SysFreeString(header->value);
heap_free(header);
free(header);
}
SysFreeString(This->raw_respheaders);
......@@ -180,7 +180,7 @@ static void free_request_headers(httprequest *This)
list_remove(&header->entry);
SysFreeString(header->header);
SysFreeString(header->value);
heap_free(header);
free(header);
}
}
......@@ -290,7 +290,7 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
if (This->binding) IBinding_Release(This->binding);
if (This->stream) IStream_Release(This->stream);
if (This->body) GlobalFree(This->body);
heap_free(This);
free(This);
}
return ref;
......@@ -560,7 +560,7 @@ static void add_response_header(httprequest *This, const WCHAR *data, int len)
/* new header */
TRACE("got header %s:%s\n", debugstr_w(header), debugstr_w(value));
entry = heap_alloc(sizeof(*entry));
entry = malloc(sizeof(*entry));
entry->header = header;
entry->value = value;
list_add_head(&This->respheaders, &entry->entry);
......@@ -684,7 +684,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
HRESULT hr;
LONG size;
if (!(bsc = heap_alloc(sizeof(*bsc))))
if (!(bsc = malloc(sizeof(*bsc))))
return E_OUTOFMEMORY;
bsc->IBindStatusCallback_iface.lpVtbl = &BindStatusCallbackVtbl;
......@@ -726,9 +726,9 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
}
size = WideCharToMultiByte(cp, 0, str, len, NULL, 0, NULL, NULL);
if (!(ptr = heap_alloc(size)))
if (!(ptr = malloc(size)))
{
heap_free(bsc);
free(bsc);
return E_OUTOFMEMORY;
}
WideCharToMultiByte(cp, 0, str, len, ptr, size, NULL, NULL);
......@@ -740,13 +740,13 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
sa = V_ARRAY(body);
if ((hr = SafeArrayAccessData(sa, &ptr)) != S_OK)
{
heap_free(bsc);
free(bsc);
return hr;
}
if ((hr = SafeArrayGetUBound(sa, 1, &size)) != S_OK)
{
SafeArrayUnaccessData(sa);
heap_free(bsc);
free(bsc);
return hr;
}
size++;
......@@ -769,11 +769,11 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
if (!bsc->body)
{
if (V_VT(body) == VT_BSTR)
heap_free(ptr);
free(ptr);
else if (V_VT(body) == (VT_ARRAY|VT_UI1))
SafeArrayUnaccessData(sa);
heap_free(bsc);
free(bsc);
return E_OUTOFMEMORY;
}
......@@ -783,7 +783,7 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
}
if (V_VT(body) == VT_BSTR)
heap_free(ptr);
free(ptr);
else if (V_VT(body) == (VT_ARRAY|VT_UI1))
SafeArrayUnaccessData(sa);
}
......@@ -1005,7 +1005,7 @@ static HRESULT httprequest_setRequestHeader(httprequest *This, BSTR header, BSTR
}
}
entry = heap_alloc(sizeof(*entry));
entry = malloc(sizeof(*entry));
if (!entry) return E_OUTOFMEMORY;
/* new header */
......@@ -1404,7 +1404,7 @@ static ULONG WINAPI XMLHTTPRequest_Release(IXMLHTTPRequest *iface)
if (!ref)
{
httprequest_release(request);
heap_free(request);
free(request);
}
return ref;
......@@ -1831,7 +1831,7 @@ static ULONG WINAPI ServerXMLHTTPRequest_Release(IServerXMLHTTPRequest *iface)
if (!ref)
{
httprequest_release(&request->req);
heap_free(request);
free(request);
}
return ref;
......@@ -2091,7 +2091,7 @@ HRESULT XMLHTTPRequest_create(void **obj)
TRACE("(%p)\n", obj);
req = heap_alloc( sizeof (*req) );
req = malloc(sizeof(*req));
if( !req )
return E_OUTOFMEMORY;
......@@ -2109,7 +2109,7 @@ HRESULT ServerXMLHTTP_create(void **obj)
TRACE("(%p)\n", obj);
req = heap_alloc( sizeof (*req) );
req = malloc(sizeof(*req));
if( !req )
return E_OUTOFMEMORY;
......
......@@ -170,12 +170,12 @@ static int to_utf8(int cp, unsigned char *out, int *outlen, const unsigned char
if (!in || !inlen) goto done;
len = MultiByteToWideChar(cp, 0, (const char *)in, *inlen, NULL, 0);
tmp = heap_alloc(len * sizeof(WCHAR));
tmp = malloc(len * sizeof(WCHAR));
if (!tmp) return -1;
MultiByteToWideChar(cp, 0, (const char *)in, *inlen, tmp, len);
len = WideCharToMultiByte(CP_UTF8, 0, tmp, len, (char *)out, *outlen, NULL, NULL);
heap_free(tmp);
free(tmp);
if (!len) return -1;
done:
*outlen = len;
......@@ -190,12 +190,12 @@ static int from_utf8(int cp, unsigned char *out, int *outlen, const unsigned cha
if (!in || !inlen) goto done;
len = MultiByteToWideChar(CP_UTF8, 0, (const char *)in, *inlen, NULL, 0);
tmp = heap_alloc(len * sizeof(WCHAR));
tmp = malloc(len * sizeof(WCHAR));
if (!tmp) return -1;
MultiByteToWideChar(CP_UTF8, 0, (const char *)in, *inlen, tmp, len);
len = WideCharToMultiByte(cp, 0, tmp, len, (char *)out, *outlen, NULL, NULL);
heap_free(tmp);
free(tmp);
if (!len) return -1;
done:
*outlen = len;
......
......@@ -21,7 +21,6 @@
#include "dispex.h"
#include "wine/heap.h"
#include "wine/list.h"
typedef enum
......
......@@ -23,7 +23,6 @@
#include "dispex.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "msxml_dispex.h"
......@@ -265,7 +264,7 @@ static inline xmlChar *xmlchar_from_wcharn(const WCHAR *str, int nchars, BOOL us
xmlChar *xmlstr;
DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, nchars, NULL, 0, NULL, NULL );
xmlstr = use_xml_alloc ? xmlMalloc( len + 1 ) : heap_alloc( len + 1 );
xmlstr = use_xml_alloc ? xmlMalloc( len + 1 ) : malloc( len + 1 );
if ( xmlstr )
{
WideCharToMultiByte( CP_UTF8, 0, str, nchars, (LPSTR) xmlstr, len+1, NULL, NULL );
......@@ -279,7 +278,7 @@ static inline xmlChar *xmlchar_from_wchar( const WCHAR *str )
return xmlchar_from_wcharn(str, -1, FALSE);
}
static inline xmlChar *heap_strdupxmlChar(const xmlChar *str)
static inline xmlChar *strdupxmlChar(const xmlChar *str)
{
xmlChar *ret = NULL;
......@@ -287,7 +286,7 @@ static inline xmlChar *heap_strdupxmlChar(const xmlChar *str)
DWORD size;
size = (xmlStrlen(str)+1)*sizeof(xmlChar);
ret = heap_alloc(size);
ret = malloc(size);
memcpy(ret, str, size);
}
......
......@@ -87,7 +87,7 @@ static HRESULT declare_prefix(namespacemanager *This, const WCHAR *prefix, const
if (ctxt->count == ctxt->max_alloc)
{
ctxt->max_alloc *= 2;
ctxt->ns = heap_realloc(ctxt->ns, ctxt->max_alloc*sizeof(*ctxt->ns));
ctxt->ns = realloc(ctxt->ns, ctxt->max_alloc * sizeof(*ctxt->ns));
}
if (!prefix) prefix = emptyW;
......@@ -173,15 +173,15 @@ static struct nscontext* alloc_ns_context(void)
{
struct nscontext *ctxt;
ctxt = heap_alloc(sizeof(*ctxt));
ctxt = malloc(sizeof(*ctxt));
if (!ctxt) return NULL;
ctxt->count = 0;
ctxt->max_alloc = DEFAULT_PREFIX_ALLOC_COUNT;
ctxt->ns = heap_alloc(ctxt->max_alloc*sizeof(*ctxt->ns));
ctxt->ns = malloc(ctxt->max_alloc * sizeof(*ctxt->ns));
if (!ctxt->ns)
{
heap_free(ctxt);
free(ctxt);
return NULL;
}
......@@ -191,8 +191,8 @@ static struct nscontext* alloc_ns_context(void)
ctxt->count++;
if (!ctxt->ns[0].prefix || !ctxt->ns[0].uri)
{
heap_free(ctxt->ns);
heap_free(ctxt);
free(ctxt->ns);
free(ctxt);
return NULL;
}
......@@ -209,8 +209,8 @@ static void free_ns_context(struct nscontext *ctxt)
SysFreeString(ctxt->ns[i].uri);
}
heap_free(ctxt->ns);
heap_free(ctxt);
free(ctxt->ns);
free(ctxt);
}
static HRESULT WINAPI namespacemanager_QueryInterface(IMXNamespaceManager *iface, REFIID riid, void **ppvObject)
......@@ -452,7 +452,7 @@ static ULONG WINAPI vbnamespacemanager_Release(IVBMXNamespaceManager *iface)
free_ns_context(ctxt);
}
heap_free( This );
free(This);
}
return ref;
......@@ -642,7 +642,7 @@ HRESULT MXNamespaceManager_create(void **obj)
TRACE("(%p)\n", obj);
This = heap_alloc( sizeof (*This) );
This = malloc(sizeof(*This));
if( !This )
return E_OUTOFMEMORY;
......@@ -655,7 +655,7 @@ HRESULT MXNamespaceManager_create(void **obj)
ctxt = alloc_ns_context();
if (!ctxt)
{
heap_free(This);
free(This);
return E_OUTOFMEMORY;
}
......
......@@ -237,7 +237,7 @@ static HRESULT mxattributes_grow(mxattributes *This)
if (This->length < This->allocated) return S_OK;
This->allocated *= 2;
This->attr = heap_realloc(This->attr, This->allocated*sizeof(mxattribute));
This->attr = realloc(This->attr, This->allocated * sizeof(mxattribute));
return This->attr ? S_OK : E_OUTOFMEMORY;
}
......@@ -269,7 +269,7 @@ static xml_encoding parse_encoding_name(const WCHAR *encoding)
static HRESULT init_encoded_buffer(encoded_buffer *buffer)
{
const int initial_len = 0x1000;
buffer->data = heap_alloc(initial_len);
buffer->data = malloc(initial_len);
if (!buffer->data) return E_OUTOFMEMORY;
memset(buffer->data, 0, 4);
......@@ -281,7 +281,7 @@ static HRESULT init_encoded_buffer(encoded_buffer *buffer)
static void free_encoded_buffer(encoded_buffer *buffer)
{
heap_free(buffer->data);
free(buffer->data);
}
static HRESULT get_code_page(xml_encoding encoding, UINT *cp)
......@@ -328,7 +328,7 @@ static void free_output_buffer(output_buffer *buffer)
{
list_remove(&cur->entry);
free_encoded_buffer(cur);
heap_free(cur);
free(cur);
}
}
......@@ -408,13 +408,13 @@ static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len)
char *mb;
/* if current chunk is larger than total buffer size, convert it at once using temporary allocated buffer */
mb = heap_alloc(length);
mb = malloc(length);
if (!mb)
return E_OUTOFMEMORY;
length = WideCharToMultiByte(buffer->code_page, 0, data, src_len, mb, length, NULL, NULL);
IStream_Write(writer->dest, mb, length, &written);
heap_free(mb);
free(mb);
}
}
}
......@@ -452,11 +452,11 @@ static HRESULT write_output_buffer(mxwriter *writer, const WCHAR *data, int len)
/* alloc new block if needed and retry */
if (src_len)
{
encoded_buffer *next = heap_alloc(sizeof(*next));
encoded_buffer *next = malloc(sizeof(*next));
HRESULT hr;
if (FAILED(hr = init_encoded_buffer(next))) {
heap_free(next);
free(next);
return hr;
}
......@@ -483,13 +483,13 @@ static void close_output_buffer(mxwriter *writer)
{
encoded_buffer *cur, *cur2;
heap_free(writer->buffer.encoded.data);
free(writer->buffer.encoded.data);
LIST_FOR_EACH_ENTRY_SAFE(cur, cur2, &writer->buffer.blocks, encoded_buffer, entry)
{
list_remove(&cur->entry);
free_encoded_buffer(cur);
heap_free(cur);
free(cur);
}
init_encoded_buffer(&writer->buffer.encoded);
......@@ -521,7 +521,7 @@ static WCHAR *get_escaped_string(const WCHAR *str, escape_mode mode, int *len)
/* default buffer size to something if length is unknown */
conv_len = max(2**len, default_alloc);
ptr = ret = heap_alloc(conv_len*sizeof(WCHAR));
ptr = ret = malloc(conv_len * sizeof(WCHAR));
while (p)
{
......@@ -529,7 +529,7 @@ static WCHAR *get_escaped_string(const WCHAR *str, escape_mode mode, int *len)
{
int written = ptr - ret;
conv_len *= 2;
ptr = ret = heap_realloc(ret, conv_len*sizeof(WCHAR));
ptr = ret = realloc(ret, conv_len * sizeof(WCHAR));
ptr += written;
}
......@@ -854,7 +854,7 @@ static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
SysFreeString(This->encoding);
SysFreeString(This->element);
heap_free(This);
free(This);
}
return ref;
......@@ -1281,7 +1281,7 @@ static void mxwriter_write_attribute(mxwriter *writer, const WCHAR *qname, int q
{
WCHAR *escaped = get_escaped_string(value, EscapeValue, &value_len);
write_output_buffer_quoted(writer, escaped, value_len);
heap_free(escaped);
free(escaped);
}
else
write_output_buffer_quoted(writer, value, value_len);
......@@ -1420,7 +1420,7 @@ static HRESULT WINAPI SAXContentHandler_characters(
escaped = get_escaped_string(chars, EscapeText, &len);
write_output_buffer(This, escaped, len);
heap_free(escaped);
free(escaped);
}
}
......@@ -2595,7 +2595,7 @@ HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj)
TRACE("(%p)\n", ppObj);
This = heap_alloc( sizeof (*This) );
This = malloc(sizeof(*This));
if(!This)
return E_OUTOFMEMORY;
......@@ -2635,7 +2635,7 @@ HRESULT MXWriter_create(MSXML_VERSION version, void **ppObj)
if (hr != S_OK) {
SysFreeString(This->encoding);
SysFreeString(This->version);
heap_free(This);
free(This);
return hr;
}
......@@ -2713,8 +2713,8 @@ static ULONG WINAPI MXAttributes_Release(IMXAttributes *iface)
SysFreeString(This->attr[i].value);
}
heap_free(This->attr);
heap_free(This);
free(This->attr);
free(This);
}
return ref;
......@@ -3559,7 +3559,7 @@ HRESULT SAXAttributes_create(MSXML_VERSION version, void **ppObj)
TRACE("(%p)\n", ppObj);
This = heap_alloc( sizeof (*This) );
This = malloc(sizeof(*This));
if( !This )
return E_OUTOFMEMORY;
......@@ -3570,7 +3570,7 @@ HRESULT SAXAttributes_create(MSXML_VERSION version, void **ppObj)
This->class_version = version;
This->attr = heap_alloc(default_count*sizeof(mxattribute));
This->attr = malloc(default_count * sizeof(mxattribute));
This->length = 0;
This->allocated = default_count;
......
......@@ -119,7 +119,7 @@ static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
TRACE("%p, refcount %ld.\n", iface, ref);
if (!ref)
heap_free(This);
free(This);
return ref;
}
......@@ -153,7 +153,7 @@ HRESULT node_create_supporterrorinfo(enum tid_t const *iids, void **obj)
{
SupportErrorInfo *This;
This = heap_alloc(sizeof(*This));
This = malloc(sizeof(*This));
if (!This) return E_OUTOFMEMORY;
This->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl;
......@@ -248,7 +248,7 @@ HRESULT node_set_content(xmlnode *This, LPCWSTR value)
return E_OUTOFMEMORY;
xmlNodeSetContent(This->node, str);
heap_free(str);
free(str);
return S_OK;
}
......@@ -264,13 +264,13 @@ static HRESULT node_set_content_escaped(xmlnode *This, LPCWSTR value)
escaped = xmlEncodeSpecialChars(NULL, str);
if(!escaped)
{
heap_free(str);
free(str);
return E_OUTOFMEMORY;
}
xmlNodeSetContent(This->node, escaped);
heap_free(str);
free(str);
xmlFree(escaped);
return S_OK;
......@@ -874,7 +874,7 @@ HRESULT node_put_text(xmlnode *This, BSTR text)
/* Escape the string. */
str2 = xmlEncodeEntitiesReentrant(This->node->doc, str);
heap_free(str);
free(str);
xmlNodeSetContent(This->node, str2);
xmlFree(str2);
......@@ -1323,8 +1323,8 @@ static int XMLCALL import_loader_io_close(void * context)
TRACE("%p\n", context);
heap_free(buffer->data);
heap_free(buffer);
free(buffer->data);
free(buffer);
return 0;
}
......@@ -1334,9 +1334,9 @@ static HRESULT import_loader_onDataAvailable(void *ctxt, char *ptr, DWORD len)
xmlParserInputBufferPtr inputbuffer;
struct import_buffer *buffer;
buffer = heap_alloc(sizeof(*buffer));
buffer = malloc(sizeof(*buffer));
buffer->data = heap_alloc(len);
buffer->data = malloc(len);
memcpy(buffer->data, ptr, len);
buffer->cur = 0;
buffer->len = len;
......@@ -1506,7 +1506,7 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
struct xslprocessor_par *par;
i = 0;
xslparams = heap_alloc((params->count*2 + 1)*sizeof(char*));
xslparams = malloc((params->count * 2 + 1) * sizeof(char*));
LIST_FOR_EACH_ENTRY(par, &params->list, struct xslprocessor_par, entry)
{
xslparams[i++] = (char*)xmlchar_from_wchar(par->name);
......@@ -1525,8 +1525,8 @@ HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet,
xsltFreeTransformContext(ctxt);
for (i = 0; i < params->count*2; i++)
heap_free((char*)xslparams[i]);
heap_free(xslparams);
free((char*)xslparams[i]);
free(xslparams);
}
else
result = xsltApplyStylesheet(xsltSS, This->node->doc, NULL);
......@@ -1564,7 +1564,7 @@ HRESULT node_select_nodes(const xmlnode *This, BSTR query, IXMLDOMNodeList **nod
str = xmlchar_from_wchar(query);
hr = create_selection(This->node, str, nodes);
heap_free(str);
free(str);
return hr;
}
......@@ -1713,7 +1713,7 @@ static ULONG WINAPI unknode_Release(
ref = InterlockedDecrement( &This->ref );
if(!ref) {
destroy_xmlnode(&This->node);
heap_free(This);
free(This);
}
return ref;
......@@ -2271,7 +2271,7 @@ IXMLDOMNode *create_node( xmlNodePtr node )
FIXME("only creating basic node for type %d\n", node->type);
new_node = heap_alloc(sizeof(unknode));
new_node = malloc(sizeof(unknode));
if(!new_node)
return NULL;
......
......@@ -134,7 +134,7 @@ static ULONG WINAPI xmlnodelist_Release(
{
xmldoc_release( This->parent->doc );
if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant);
heap_free( This );
free( This );
}
return ref;
......@@ -406,7 +406,7 @@ IXMLDOMNodeList* create_children_nodelist( xmlNodePtr node )
{
xmlnodelist *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -138,7 +138,7 @@ static ULONG WINAPI xmlnodemap_Release(
xmlnode_release( This->node );
xmldoc_release( This->node->doc );
if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant);
heap_free( This );
free( This );
}
return ref;
......@@ -432,7 +432,7 @@ IXMLDOMNamedNodeMap *create_nodemap(xmlNodePtr node, const struct nodemap_funcs
{
xmlnodemap *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -100,7 +100,7 @@ static ULONG WINAPI parseError_Release(
SysFreeString(This->url);
SysFreeString(This->reason);
SysFreeString(This->srcText);
heap_free( This );
free(This);
}
return ref;
......@@ -322,7 +322,7 @@ IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR src
{
parse_error_t *This;
This = heap_alloc( sizeof(*This) );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -110,7 +110,7 @@ static ULONG WINAPI dom_pi_Release(
if ( ref == 0 )
{
destroy_xmlnode(&This->node);
heap_free( This );
free(This);
}
return ref;
......@@ -303,7 +303,7 @@ static HRESULT xml_get_value(xmlChar **p, xmlChar **value)
if (!len) return XML_E_MISSINGNAME;
*p += 1;
*value = heap_alloc(len + 1);
*value = malloc(len + 1);
if (!*value) return E_OUTOFMEMORY;
memcpy(*value, v, len);
*(*value + len) = 0;
......@@ -409,9 +409,9 @@ fail:
node->properties = NULL;
}
heap_free(version);
heap_free(encoding);
heap_free(standalone);
free(version);
free(encoding);
free(standalone);
return hr;
}
......@@ -867,7 +867,7 @@ static HRESULT dom_pi_get_named_item(const xmlNodePtr node, BSTR name, IXMLDOMNo
if (!nameA) return E_OUTOFMEMORY;
attr = node_has_prop(node, nameA);
heap_free(nameA);
free(nameA);
if (!attr)
{
......@@ -945,7 +945,7 @@ IUnknown* create_pi( xmlNodePtr pi )
{
dom_pi *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -734,7 +734,7 @@ void schemasInit(void)
/* Resource is loaded as raw data,
* need a null-terminated string */
while (buf[datatypes_len - 1] != '>') datatypes_len--;
datatypes_src = heap_alloc(datatypes_len + 1);
datatypes_src = malloc(datatypes_len + 1);
memcpy(datatypes_src, buf, datatypes_len);
datatypes_src[datatypes_len] = 0;
......@@ -748,7 +748,7 @@ void schemasInit(void)
void schemasCleanup(void)
{
xmlSchemaFree(datatypes_schema);
heap_free(datatypes_src);
free(datatypes_src);
xmlSetExternalEntityLoader(_external_entity_loader);
}
......@@ -780,7 +780,7 @@ static LONG cache_entry_release(cache_entry* entry)
xmlSchemaFree(entry->schema);
}
heap_free(entry);
free(entry);
}
return ref;
}
......@@ -854,7 +854,7 @@ static BOOL link_datatypes(xmlDocPtr schema)
static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc, xmlChar const* nsURI, MSXML_VERSION v)
{
cache_entry* entry = heap_alloc(sizeof(cache_entry));
cache_entry* entry = malloc(sizeof(cache_entry));
xmlSchemaParserCtxtPtr spctx;
xmlDocPtr new_doc = xmlCopyDoc(doc, 1);
......@@ -876,7 +876,7 @@ static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc, xmlChar const* nsURI
{
FIXME("failed to parse doc\n");
xmlFreeDoc(new_doc);
heap_free(entry);
free(entry);
entry = NULL;
}
xmlSchemaFreeParserCtxt(spctx);
......@@ -885,7 +885,7 @@ static cache_entry* cache_entry_from_xsd_doc(xmlDocPtr doc, xmlChar const* nsURI
static cache_entry* cache_entry_from_xdr_doc(xmlDocPtr doc, xmlChar const* nsURI, MSXML_VERSION version)
{
cache_entry* entry = heap_alloc(sizeof(cache_entry));
cache_entry* entry = malloc(sizeof(cache_entry));
xmlSchemaParserCtxtPtr spctx;
xmlDocPtr new_doc = xmlCopyDoc(doc, 1), xsd_doc = XDR_to_XSD_doc(doc, nsURI);
......@@ -908,7 +908,7 @@ static cache_entry* cache_entry_from_xdr_doc(xmlDocPtr doc, xmlChar const* nsURI
FIXME("failed to parse doc\n");
xmlFreeDoc(new_doc);
xmlFreeDoc(xsd_doc);
heap_free(entry);
free(entry);
entry = NULL;
}
xmlSchemaFreeParserCtxt(spctx);
......@@ -978,7 +978,7 @@ static int cache_free_uri(schema_cache *cache, const xmlChar *uri)
for (i = 0; i < cache->count; i++)
if (xmlStrEqual(cache->uris[i], uri))
{
heap_free(cache->uris[i]);
free(cache->uris[i]);
return i;
}
......@@ -995,14 +995,14 @@ static void cache_add_entry(schema_cache *cache, const xmlChar *uri, cache_entry
if (cache->count == cache->allocated)
{
cache->allocated *= 2;
cache->uris = heap_realloc(cache->uris, cache->allocated*sizeof(xmlChar*));
cache->uris = realloc(cache->uris, cache->allocated * sizeof(xmlChar*));
}
i = cache->count++;
}
else
i = cache_free_uri(cache, uri);
cache->uris[i] = heap_strdupxmlChar(uri);
cache->uris[i] = strdupxmlChar(uri);
xmlHashAddEntry(cache->cache, uri, entry);
}
......@@ -1059,7 +1059,7 @@ HRESULT cache_from_doc_ns(IXMLDOMSchemaCollection2 *iface, xmlnode *node)
continue;
}
entry = heap_alloc(sizeof(cache_entry));
entry = malloc(sizeof(cache_entry));
entry->type = CacheEntryType_NS;
entry->ref = 1;
entry->schema = NULL;
......@@ -1141,10 +1141,10 @@ static ULONG WINAPI schema_cache_Release(IXMLDOMSchemaCollection2* iface)
int i;
for (i = 0; i < This->count; i++)
heap_free(This->uris[i]);
heap_free(This->uris);
free(This->uris[i]);
free(This->uris);
xmlHashFree(This->cache, cache_free);
heap_free(This);
free(This);
}
return ref;
......@@ -1214,7 +1214,7 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
}
else
{
heap_free(name);
free(name);
return E_FAIL;
}
......@@ -1260,7 +1260,7 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
if (!doc)
{
IXMLDOMNode_Release(domnode);
heap_free(name);
free(name);
return E_INVALIDARG;
}
type = cache_type_from_xmlDocPtr(doc);
......@@ -1287,7 +1287,7 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
}
else
{
heap_free(name);
free(name);
return E_FAIL;
}
......@@ -1297,10 +1297,10 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri
default:
FIXME("arg type is not supported, %s\n", debugstr_variant(&var));
heap_free(name);
free(name);
return E_INVALIDARG;
}
heap_free(name);
free(name);
return S_OK;
}
......@@ -1326,7 +1326,7 @@ static HRESULT WINAPI schema_cache_get(IXMLDOMSchemaCollection2* iface, BSTR uri
name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
entry = (cache_entry*) xmlHashLookup(This->cache, name);
heap_free(name);
free(name);
/* TODO: this should be read-only */
if (entry && entry->doc)
......@@ -1346,7 +1346,7 @@ static HRESULT WINAPI schema_cache_remove(IXMLDOMSchemaCollection2* iface, BSTR
name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW);
cache_remove_entry(This, name);
heap_free(name);
free(name);
return S_OK;
}
......@@ -1600,7 +1600,7 @@ static dispex_static_data_t schemacache_dispex = {
HRESULT SchemaCache_create(MSXML_VERSION version, void** obj)
{
schema_cache* This = heap_alloc(sizeof(schema_cache));
schema_cache* This = malloc(sizeof(schema_cache));
if (!This)
return E_OUTOFMEMORY;
......@@ -1610,7 +1610,7 @@ HRESULT SchemaCache_create(MSXML_VERSION version, void** obj)
This->cache = xmlHashCreate(DEFAULT_HASHTABLE_SIZE);
This->allocated = 10;
This->count = 0;
This->uris = heap_alloc(This->allocated*sizeof(xmlChar*));
This->uris = malloc(This->allocated * sizeof(xmlChar*));
This->ref = 1;
This->version = version;
This->validateOnLoad = VARIANT_TRUE;
......
......@@ -171,7 +171,7 @@ static ULONG WINAPI domselection_Release(
xmlXPathFreeObject(This->result);
xmldoc_release(This->node->doc);
if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant);
heap_free(This);
free(This);
}
return ref;
......@@ -481,7 +481,7 @@ static ULONG WINAPI enumvariant_Release(IEnumVARIANT *iface )
if ( ref == 0 )
{
if (This->own) IUnknown_Release(This->outer);
heap_free(This);
free(This);
}
return ref;
......@@ -566,7 +566,7 @@ HRESULT create_enumvariant(IUnknown *outer, BOOL own, const struct enumvariant_f
{
enumvariant *This;
This = heap_alloc(sizeof(enumvariant));
This = malloc(sizeof(enumvariant));
if (!This) return E_OUTOFMEMORY;
This->IEnumVARIANT_iface.lpVtbl = &EnumVARIANTVtbl;
......@@ -763,7 +763,7 @@ static void query_serror(void* ctx, xmlErrorPtr err)
HRESULT create_selection(xmlNodePtr node, xmlChar* query, IXMLDOMNodeList **out)
{
domselection *This = heap_alloc(sizeof(domselection));
domselection *This = malloc(sizeof(domselection));
xmlXPathContextPtr ctxt = xmlXPathNewContext(node->doc);
HRESULT hr;
......@@ -773,7 +773,7 @@ HRESULT create_selection(xmlNodePtr node, xmlChar* query, IXMLDOMNodeList **out)
if (!This || !ctxt || !query)
{
xmlXPathFreeContext(ctxt);
heap_free(This);
free(This);
return E_OUTOFMEMORY;
}
......
......@@ -96,7 +96,7 @@ static void xslprocessor_par_free(struct xslprocessor_params *params, struct xsl
list_remove(&par->entry);
SysFreeString(par->name);
SysFreeString(par->value);
heap_free(par);
free(par);
}
static void xsltemplate_set_node( xsltemplate *This, IXMLDOMNode *node )
......@@ -152,7 +152,7 @@ static ULONG WINAPI xsltemplate_Release( IXSLTemplate *iface )
if ( ref == 0 )
{
if (This->node) IXMLDOMNode_Release( This->node );
heap_free( This );
free( This );
}
return ref;
......@@ -267,7 +267,7 @@ HRESULT XSLTemplate_create(void **ppObj)
TRACE("(%p)\n", ppObj);
This = heap_alloc( sizeof (*This) );
This = malloc(sizeof(*This));
if(!This)
return E_OUTOFMEMORY;
......@@ -340,7 +340,7 @@ static ULONG WINAPI xslprocessor_Release( IXSLProcessor *iface )
xslprocessor_par_free(&This->params, par);
IXSLTemplate_Release(&This->stylesheet->IXSLTemplate_iface);
heap_free( This );
free(This);
}
return ref;
......@@ -726,13 +726,13 @@ static HRESULT WINAPI xslprocessor_addParameter(
else
{
/* new parameter */
par = heap_alloc(sizeof(struct xslprocessor_par));
par = malloc(sizeof(struct xslprocessor_par));
if (!par) return E_OUTOFMEMORY;
par->name = SysAllocString(p);
if (!par->name)
{
heap_free(par);
free(par);
return E_OUTOFMEMORY;
}
list_add_tail(&This->params.list, &par->entry);
......@@ -810,7 +810,7 @@ HRESULT XSLProcessor_create(xsltemplate *template, IXSLProcessor **ppObj)
TRACE("(%p)\n", ppObj);
This = heap_alloc( sizeof (*This) );
This = malloc(sizeof(*This));
if(!This)
return E_OUTOFMEMORY;
......
......@@ -105,7 +105,7 @@ static ULONG WINAPI domtext_Release(
if ( ref == 0 )
{
destroy_xmlnode(&This->node);
heap_free( This );
free(This);
}
return ref;
......@@ -941,7 +941,7 @@ IUnknown* create_text( xmlNodePtr text )
{
domtext *This;
This = heap_alloc( sizeof *This );
This = malloc(sizeof(*This));
if ( !This )
return NULL;
......
......@@ -117,7 +117,7 @@ static ULONG WINAPI xmldoc_Release(IXMLDocument *iface)
{
xmlFreeDoc(This->xmldoc);
if (This->stream) IStream_Release(This->stream);
heap_free(This);
free(This);
}
return ref;
......@@ -687,7 +687,7 @@ HRESULT XMLDocument_create(LPVOID *ppObj)
TRACE("(%p)\n", ppObj);
doc = heap_alloc(sizeof (*doc));
doc = malloc(sizeof(*doc));
if(!doc)
return E_OUTOFMEMORY;
......
......@@ -97,7 +97,7 @@ static ULONG WINAPI xmlelem_Release(IXMLElement *iface)
if (ref == 0)
{
if (This->own) xmlFreeNode(This->node);
heap_free(This);
free(This);
}
return ref;
......@@ -232,8 +232,8 @@ static HRESULT WINAPI xmlelem_setAttribute(IXMLElement *iface, BSTR strPropertyN
value = xmlchar_from_wchar(V_BSTR(&PropertyValue));
attr = xmlSetProp(This->node, name, value);
heap_free(name);
heap_free(value);
free(name);
free(value);
return (attr) ? S_OK : S_FALSE;
}
......@@ -285,7 +285,7 @@ static HRESULT WINAPI xmlelem_getAttribute(IXMLElement *iface, BSTR name,
SysFreeString(attr_name);
}
heap_free(xml_name);
free(xml_name);
}
if (val)
......@@ -323,7 +323,7 @@ static HRESULT WINAPI xmlelem_removeAttribute(IXMLElement *iface, BSTR strProper
hr = S_OK;
done:
heap_free(name);
free(name);
return hr;
}
......@@ -408,7 +408,7 @@ static HRESULT WINAPI xmlelem_put_text(IXMLElement *iface, BSTR p)
content = xmlchar_from_wchar(p);
xmlNodeSetContent(This->node, content);
heap_free(content);
free(content);
return S_OK;
}
......@@ -488,7 +488,7 @@ HRESULT XMLElement_create(xmlNodePtr node, LPVOID *ppObj, BOOL own)
*ppObj = NULL;
elem = heap_alloc(sizeof (*elem));
elem = malloc(sizeof(*elem));
if(!elem)
return E_OUTOFMEMORY;
......@@ -585,7 +585,7 @@ static ULONG WINAPI xmlelem_collection_Release(IXMLElementCollection *iface)
ref = InterlockedDecrement(&This->ref);
if (ref == 0)
{
heap_free(This);
free(This);
}
return ref;
......@@ -815,7 +815,7 @@ static HRESULT XMLElementCollection_create(xmlNodePtr node, LPVOID *ppObj)
if (!node->children)
return S_FALSE;
collection = heap_alloc(sizeof (*collection));
collection = malloc(sizeof(*collection));
if(!collection)
return E_OUTOFMEMORY;
......
......@@ -27,7 +27,6 @@
#include "xmlparser.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(msxml);
......@@ -92,7 +91,7 @@ static ULONG WINAPI xmlparser_Release(IXMLParser* iface)
if(This->nodefactory)
IXMLNodeFactory_Release(This->nodefactory);
heap_free( This );
free(This);
}
return ref;
......@@ -418,7 +417,7 @@ HRESULT XMLParser_create(void **ppObj)
TRACE("(%p)\n", ppObj);
This = heap_alloc( sizeof(xmlparser) );
This = malloc(sizeof(xmlparser));
if(!This)
return E_OUTOFMEMORY;
......
......@@ -114,7 +114,7 @@ static ULONG WINAPI XMLView_Binding_Release(IBinding *iface)
if(!ref) {
IBinding_Release(This->binding);
heap_free(This);
free(This);
}
return ref;
}
......@@ -185,7 +185,7 @@ static inline HRESULT XMLView_Binding_Create(IBinding *binding, IBinding **ret)
{
Binding *bind;
bind = heap_alloc_zero(sizeof(Binding));
bind = calloc(1, sizeof(Binding));
if(!bind)
return E_OUTOFMEMORY;
......@@ -247,7 +247,7 @@ static ULONG WINAPI XMLView_BindStatusCallback_Release(
IStream_Release(This->stream);
IBindStatusCallback_Release(This->bsc);
IMoniker_Release(This->mon);
heap_free(This);
free(This);
}
return ref;
}
......@@ -555,7 +555,7 @@ static inline HRESULT XMLView_BindStatusCallback_Create(IBindStatusCallback *bsc
{
BindStatusCallback *bsc;
bsc = heap_alloc_zero(sizeof(BindStatusCallback));
bsc = calloc(1, sizeof(BindStatusCallback));
if(!bsc)
return E_OUTOFMEMORY;
......@@ -615,7 +615,7 @@ static ULONG WINAPI XMLView_Moniker_Release(IMoniker *iface)
if(!ref) {
IMoniker_Release(This->mon);
heap_free(This);
free(This);
}
return ref;
}
......@@ -819,7 +819,7 @@ static inline HRESULT XMLView_Moniker_Create(IMoniker *mon,
{
Moniker *wrap;
wrap = heap_alloc_zero(sizeof(Moniker));
wrap = calloc(1, sizeof(Moniker));
if(!wrap)
return E_OUTOFMEMORY;
......@@ -884,7 +884,7 @@ static ULONG WINAPI XMLView_PersistMoniker_Release(IPersistMoniker *iface)
if(This->mon)
IMoniker_Release(This->mon);
IUnknown_Release(This->html_doc);
heap_free(This);
free(This);
}
return ref;
}
......@@ -1405,7 +1405,7 @@ HRESULT XMLView_create(void **ppObj)
TRACE("(%p)\n", ppObj);
This = heap_alloc_zero(sizeof(*This));
This = calloc(1, sizeof(*This));
if(!This)
return E_OUTOFMEMORY;
......@@ -1418,7 +1418,7 @@ HRESULT XMLView_create(void **ppObj)
hres = CoCreateInstance(&CLSID_HTMLDocument, (IUnknown*)&This->IPersistMoniker_iface,
CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&This->html_doc);
if(FAILED(hres)) {
heap_free(This);
free(This);
return hres;
}
......
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