Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
73685eb0
Commit
73685eb0
authored
Feb 17, 2024
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msxml3: Use CRT allocation functions.
parent
56139179
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
223 additions
and
227 deletions
+223
-227
attribute.c
dlls/msxml3/attribute.c
+2
-2
bsc.c
dlls/msxml3/bsc.c
+2
-2
cdata.c
dlls/msxml3/cdata.c
+2
-2
comment.c
dlls/msxml3/comment.c
+2
-2
dispex.c
dlls/msxml3/dispex.c
+9
-10
docfrag.c
dlls/msxml3/docfrag.c
+2
-2
doctype.c
dlls/msxml3/doctype.c
+2
-2
domdoc.c
dlls/msxml3/domdoc.c
+29
-29
domimpl.c
dlls/msxml3/domimpl.c
+2
-2
element.c
dlls/msxml3/element.c
+22
-22
entityref.c
dlls/msxml3/entityref.c
+2
-2
factory.c
dlls/msxml3/factory.c
+3
-3
httprequest.c
dlls/msxml3/httprequest.c
+17
-17
main.c
dlls/msxml3/main.c
+4
-4
msxml_dispex.h
dlls/msxml3/msxml_dispex.h
+0
-1
msxml_private.h
dlls/msxml3/msxml_private.h
+3
-4
mxnamespace.c
dlls/msxml3/mxnamespace.c
+11
-11
mxwriter.c
dlls/msxml3/mxwriter.c
+21
-21
node.c
dlls/msxml3/node.c
+16
-16
nodelist.c
dlls/msxml3/nodelist.c
+2
-2
nodemap.c
dlls/msxml3/nodemap.c
+2
-2
parseerror.c
dlls/msxml3/parseerror.c
+2
-2
pi.c
dlls/msxml3/pi.c
+7
-7
schema.c
dlls/msxml3/schema.c
+23
-23
selection.c
dlls/msxml3/selection.c
+5
-5
stylesheet.c
dlls/msxml3/stylesheet.c
+7
-7
text.c
dlls/msxml3/text.c
+2
-2
xmldoc.c
dlls/msxml3/xmldoc.c
+2
-2
xmlelem.c
dlls/msxml3/xmlelem.c
+9
-9
xmlparser.c
dlls/msxml3/xmlparser.c
+2
-3
xmlview.c
dlls/msxml3/xmlview.c
+9
-9
No files found.
dlls/msxml3/attribute.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/bsc.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
sizeof
(
bsc_t
));
bsc
->
IBindStatusCallback_iface
.
lpVtbl
=
&
bsc_vtbl
;
bsc
->
ref
=
1
;
...
...
dlls/msxml3/cdata.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/comment.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/dispex.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
);
...
...
dlls/msxml3/docfrag.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/doctype.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/domdoc.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
;
}
...
...
dlls/msxml3/domimpl.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
object
->
IXMLDOMImplementation_iface
.
lpVtbl
=
&
domimpl_vtbl
;
...
...
dlls/msxml3/element.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/entityref.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/factory.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
;
...
...
dlls/msxml3/httprequest.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
;
...
...
dlls/msxml3/main.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
;
...
...
dlls/msxml3/msxml_dispex.h
View file @
73685eb0
...
...
@@ -21,7 +21,6 @@
#include "dispex.h"
#include "wine/heap.h"
#include "wine/list.h"
typedef
enum
...
...
dlls/msxml3/msxml_private.h
View file @
73685eb0
...
...
@@ -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
)
:
m
alloc
(
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
=
m
alloc
(
size
);
memcpy
(
ret
,
str
,
size
);
}
...
...
dlls/msxml3/mxnamespace.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
;
}
...
...
dlls/msxml3/mxwriter.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
;
...
...
dlls/msxml3/node.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
sizeof
(
*
buffer
));
buffer
->
data
=
heap_
alloc
(
len
);
buffer
->
data
=
m
alloc
(
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
=
m
alloc
(
sizeof
(
unknode
));
if
(
!
new_node
)
return
NULL
;
...
...
dlls/msxml3/nodelist.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/nodemap.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/parseerror.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/pi.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
;
...
...
dlls/msxml3/schema.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
=
m
alloc
(
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
;
...
...
dlls/msxml3/selection.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
=
m
alloc
(
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
;
}
...
...
dlls/msxml3/stylesheet.c
View file @
73685eb0
...
...
@@ -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
=
m
alloc
(
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
;
...
...
dlls/msxml3/text.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/xmldoc.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/xmlelem.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/xmlparser.c
View file @
73685eb0
...
...
@@ -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
;
...
...
dlls/msxml3/xmlview.c
View file @
73685eb0
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment