ole32/pointermoniker: Use CRT allocation functions.

This commit is contained in:
Nikolay Sivov 2023-05-27 10:45:37 +02:00 committed by Alexandre Julliard
parent a9d3d435bc
commit 894f1cde4a

View file

@ -32,7 +32,6 @@
#include "objbase.h"
#include "oleidl.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "moniker.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
@ -110,7 +109,7 @@ static ULONG WINAPI PointerMonikerImpl_Release(IMoniker *iface)
if (!refcount)
{
if (moniker->pObject) IUnknown_Release(moniker->pObject);
heap_free(moniker);
free(moniker);
}
return refcount;
@ -600,8 +599,7 @@ HRESULT WINAPI CreatePointerMoniker(IUnknown *object, IMoniker **ret)
if (!ret)
return E_INVALIDARG;
moniker = heap_alloc(sizeof(*moniker));
if (!moniker)
if (!(moniker = calloc(1, sizeof(*moniker))))
{
*ret = NULL;
return E_OUTOFMEMORY;
@ -714,7 +712,7 @@ static ULONG WINAPI ObjrefMonikerImpl_Release(IMoniker *iface)
if (!refcount)
{
if (moniker->pObject) IUnknown_Release(moniker->pObject);
heap_free(moniker);
free(moniker);
}
return refcount;
@ -1017,8 +1015,7 @@ HRESULT WINAPI CreateObjrefMoniker(IUnknown *obj, IMoniker **ret)
if (!ret)
return E_INVALIDARG;
moniker = heap_alloc(sizeof(*moniker));
if (!moniker)
if (!(moniker = calloc(1, sizeof(*moniker))))
{
*ret = NULL;
return E_OUTOFMEMORY;