Commit 8ef070b6 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

dpnet: Use standard C functions for memory allocation in peer.c.

parent a407ba9f
...@@ -92,10 +92,10 @@ static ULONG WINAPI IDirectPlay8PeerImpl_Release(IDirectPlay8Peer *iface) ...@@ -92,10 +92,10 @@ static ULONG WINAPI IDirectPlay8PeerImpl_Release(IDirectPlay8Peer *iface)
if(!RefCount) if(!RefCount)
{ {
heap_free(This->username); free(This->username);
heap_free(This->data); free(This->data);
heap_free(This); free(This);
} }
return RefCount; return RefCount;
...@@ -389,12 +389,12 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface, ...@@ -389,12 +389,12 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface,
if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_NAME) if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_NAME)
{ {
heap_free(This->username); free(This->username);
This->username = NULL; This->username = NULL;
if(pdpnPlayerInfo->pwszName) if(pdpnPlayerInfo->pwszName)
{ {
This->username = heap_strdupW(pdpnPlayerInfo->pwszName); This->username = wcsdup(pdpnPlayerInfo->pwszName);
if (!This->username) if (!This->username)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -402,10 +402,10 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface, ...@@ -402,10 +402,10 @@ static HRESULT WINAPI IDirectPlay8PeerImpl_SetPeerInfo(IDirectPlay8Peer *iface,
if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_DATA) if (pdpnPlayerInfo->dwInfoFlags & DPNINFO_DATA)
{ {
heap_free(This->data); free(This->data);
This->datasize = pdpnPlayerInfo->dwDataSize; This->datasize = pdpnPlayerInfo->dwDataSize;
This->data = heap_alloc(pdpnPlayerInfo->dwDataSize); This->data = malloc(pdpnPlayerInfo->dwDataSize);
if (!This->data) if (!This->data)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
...@@ -638,7 +638,7 @@ HRESULT DPNET_CreateDirectPlay8Peer(IClassFactory *iface, IUnknown *pUnkOuter, R ...@@ -638,7 +638,7 @@ HRESULT DPNET_CreateDirectPlay8Peer(IClassFactory *iface, IUnknown *pUnkOuter, R
IDirectPlay8PeerImpl* Client; IDirectPlay8PeerImpl* Client;
HRESULT ret; HRESULT ret;
Client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8PeerImpl)); Client = calloc(1, sizeof(IDirectPlay8PeerImpl));
*ppobj = NULL; *ppobj = NULL;
......
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