From ebbf3e1aa6cb9541c8fc7b6d63dff283e81ac005 Mon Sep 17 00:00:00 2001 From: Mark Jansen Date: Sat, 8 Apr 2017 19:06:46 +0000 Subject: [PATCH] [WIN32SS] Addendum to r74285, actually leak the pointer used by Freetype, so that when it is accessed later, we have not freed it. svn path=/trunk/; revision=74286 --- reactos/win32ss/gdi/ntgdi/freetype.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/win32ss/gdi/ntgdi/freetype.c b/reactos/win32ss/gdi/ntgdi/freetype.c index e6511de63c3..14e41d5d511 100644 --- a/reactos/win32ss/gdi/ntgdi/freetype.c +++ b/reactos/win32ss/gdi/ntgdi/freetype.c @@ -1070,8 +1070,16 @@ IntGdiAddFontMemResource(PVOID Buffer, DWORD dwSize, PDWORD pNumAdded) INT FontCount; HANDLE Ret = 0; + /* We leak this buffer for now, same as all fonts do with their buffer! */ + LoadFont.Buffer = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); + if (!LoadFont.Buffer) + { + *pNumAdded = 0; + return NULL; + } + memcpy(LoadFont.Buffer, Buffer, dwSize); + LoadFont.pFileName = NULL; - LoadFont.Buffer = Buffer; LoadFont.BufferSize = dwSize; LoadFont.Characteristics = FR_PRIVATE | FR_NOT_ENUM; RtlInitUnicodeString(&LoadFont.RegValueName, NULL);