Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
02bb8401
Commit
02bb8401
authored
Nov 16, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Use standard C functions for memory allocation in protocol.c.
parent
8459a527
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
24 deletions
+7
-24
protocol.c
dlls/inetcomm/protocol.c
+7
-24
No files found.
dlls/inetcomm/protocol.c
View file @
02bb8401
...
...
@@ -25,7 +25,6 @@
#include "inetcomm_private.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
inetcomm
);
...
...
@@ -62,22 +61,6 @@ typedef struct {
static
const
WCHAR
mhtml_prefixW
[]
=
L"mhtml:"
;
static
const
WCHAR
mhtml_separatorW
[]
=
L"!x-usc:"
;
static
inline
LPWSTR
heap_strdupW
(
LPCWSTR
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
size
;
size
=
(
lstrlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
}
return
ret
;
}
static
HRESULT
parse_mhtml_url
(
const
WCHAR
*
url
,
mhtml_url_t
*
r
)
{
const
WCHAR
*
p
;
...
...
@@ -247,7 +230,7 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
IInternetProtocol_Release
(
&
This
->
protocol
->
IInternetProtocol_iface
);
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
heap_
free
(
This
);
free
(
This
);
}
return
ref
;
...
...
@@ -419,8 +402,8 @@ static ULONG WINAPI MimeHtmlProtocol_Release(IUnknown *iface)
IInternetProtocolSink_Release
(
This
->
sink
);
if
(
This
->
stream
)
IStream_Release
(
This
->
stream
);
heap_
free
(
This
->
location
);
heap_
free
(
This
);
free
(
This
->
location
);
free
(
This
);
}
return
ref
;
...
...
@@ -475,7 +458,7 @@ static HRESULT WINAPI MimeHtmlProtocol_Start(IInternetProtocol *iface, const WCH
if
(
FAILED
(
hres
))
return
hres
;
if
(
url
.
location
&&
!
(
This
->
location
=
heap_strdupW
(
url
.
location
)))
if
(
url
.
location
&&
!
(
This
->
location
=
wcsdup
(
url
.
location
)))
return
E_OUTOFMEMORY
;
hres
=
IInternetBindInfo_GetBindInfo
(
pOIBindInfo
,
&
bindf
,
&
bindinfo
);
...
...
@@ -488,7 +471,7 @@ static HRESULT WINAPI MimeHtmlProtocol_Start(IInternetProtocol *iface, const WCH
IInternetProtocolSink_AddRef
(
This
->
sink
=
pOIProtSink
);
binding
=
heap_alloc
(
FIELD_OFFSET
(
MimeHtmlBinding
,
url
[
url
.
mhtml_len
+
1
]));
binding
=
malloc
(
FIELD_OFFSET
(
MimeHtmlBinding
,
url
[
url
.
mhtml_len
+
1
]));
if
(
!
binding
)
return
E_OUTOFMEMORY
;
memcpy
(
binding
->
url
,
url
.
mhtml
,
url
.
mhtml_len
*
sizeof
(
WCHAR
));
...
...
@@ -496,7 +479,7 @@ static HRESULT WINAPI MimeHtmlProtocol_Start(IInternetProtocol *iface, const WCH
hres
=
CreateURLMoniker
(
NULL
,
binding
->
url
,
&
mon
);
if
(
FAILED
(
hres
))
{
heap_
free
(
binding
);
free
(
binding
);
return
hres
;
}
...
...
@@ -729,7 +712,7 @@ HRESULT MimeHtmlProtocol_create(IUnknown *outer, void **obj)
{
MimeHtmlProtocol
*
protocol
;
protocol
=
heap_
alloc
(
sizeof
(
*
protocol
));
protocol
=
m
alloc
(
sizeof
(
*
protocol
));
if
(
!
protocol
)
return
E_OUTOFMEMORY
;
...
...
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