1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 03:45:57 +00:00

oledb32: Use standard C functions for memory allocation in rowpos.c.

This commit is contained in:
Alex Henrie 2022-11-21 22:31:41 -07:00 committed by Alexandre Julliard
parent f41214edaa
commit 777383b81d
2 changed files with 6 additions and 11 deletions

View File

@ -27,8 +27,3 @@ HRESULT get_data_source(IUnknown *outer, DWORD clsctx, LPWSTR initstring, REFIID
IUnknown **datasource) DECLSPEC_HIDDEN;
extern HINSTANCE instance;
static inline void* __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t size)
{
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, size);
}

View File

@ -28,7 +28,6 @@
#include "oledb_private.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(oledb);
@ -152,7 +151,7 @@ static ULONG WINAPI rowpos_Release(IRowPosition* iface)
if (This->rowset) IRowset_Release(This->rowset);
if (This->chrst) IChapteredRowset_Release(This->chrst);
rowposchange_cp_destroy(&This->cp);
heap_free(This);
free(This);
}
return ref;
@ -405,16 +404,17 @@ static HRESULT WINAPI rowpos_cp_Advise(IConnectionPoint *iface, IUnknown *unksin
if (i == This->sinks_size)
{
new_sinks = heap_realloc_zero(This->sinks, 2 * This->sinks_size * sizeof(*This->sinks));
new_sinks = realloc(This->sinks, 2 * This->sinks_size * sizeof(*This->sinks));
if (!new_sinks)
return E_OUTOFMEMORY;
memset(new_sinks + This->sinks_size, 0, This->sinks_size * sizeof(*This->sinks));
This->sinks = new_sinks;
This->sinks_size *= 2;
}
}
else
{
This->sinks = heap_alloc_zero(10 * sizeof(*This->sinks));
This->sinks = calloc(10, sizeof(*This->sinks));
if (!This->sinks)
return E_OUTOFMEMORY;
This->sinks_size = 10;
@ -477,7 +477,7 @@ void rowposchange_cp_destroy(rowpos_cp *cp)
if (cp->sinks[i])
IRowPositionChange_Release(cp->sinks[i]);
}
heap_free(cp->sinks);
free(cp->sinks);
}
HRESULT create_oledb_rowpos(IUnknown *outer, void **obj)
@ -490,7 +490,7 @@ HRESULT create_oledb_rowpos(IUnknown *outer, void **obj)
if(outer) return CLASS_E_NOAGGREGATION;
This = heap_alloc(sizeof(*This));
This = malloc(sizeof(*This));
if(!This) return E_OUTOFMEMORY;
This->IRowPosition_iface.lpVtbl = &rowpos_vtbl;