diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 32f20d8c1fd..128145581df 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -420,12 +420,10 @@ BOOL lengthen_path(GpPath *path, INT len) while(path->datalen - path->pathdata.Count < len) path->datalen *= 2; - path->pathdata.Points = HeapReAlloc(GetProcessHeap(), 0, - path->pathdata.Points, path->datalen * sizeof(PointF)); + path->pathdata.Points = heap_realloc(path->pathdata.Points, path->datalen * sizeof(PointF)); if(!path->pathdata.Points) return FALSE; - path->pathdata.Types = HeapReAlloc(GetProcessHeap(), 0, - path->pathdata.Types, path->datalen); + path->pathdata.Types = heap_realloc(path->pathdata.Types, path->datalen); if(!path->pathdata.Types) return FALSE; } diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index d0faac256fb..1af0bd056f6 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -60,6 +60,12 @@ static inline void *heap_alloc_zero(size_t len) return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); } +static void *heap_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2); +static inline void *heap_realloc(void *mem, size_t len) +{ + return HeapReAlloc(GetProcessHeap(), 0, mem, len); +} + static inline BOOL heap_free(void *mem) { return HeapFree(GetProcessHeap(), 0, mem); diff --git a/dlls/gdiplus/stringformat.c b/dlls/gdiplus/stringformat.c index 8791ceb0ef2..b89458bdeb6 100644 --- a/dlls/gdiplus/stringformat.c +++ b/dlls/gdiplus/stringformat.c @@ -291,7 +291,7 @@ GpStatus WINGDIPAPI GdipSetStringFormatTabStops(GpStringFormat *format, REAL fir /* reallocation */ if((format->tabcount < count) && (format->tabcount > 0)){ REAL *ptr; - ptr = HeapReAlloc(GetProcessHeap(), 0, format->tabs, sizeof(REAL)*count); + ptr = heap_realloc(format->tabs, sizeof(REAL)*count); if(!ptr) return OutOfMemory; format->tabs = ptr;