mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 09:35:52 +00:00
inetcomm: Use standard C functions for memory allocation in protocol.c.
This commit is contained in:
parent
8459a5272a
commit
02bb8401d7
|
@ -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 = malloc(sizeof(*protocol));
|
||||
if(!protocol)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
|
|
Loading…
Reference in a new issue