[WIN32SS] Addendum to r74285, actually leak the pointer used by Freetype, so that...
authorMark Jansen <mark.jansen@reactos.org>
Sat, 8 Apr 2017 19:06:46 +0000 (19:06 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 8 Apr 2017 19:06:46 +0000 (19:06 +0000)
svn path=/trunk/; revision=74286

reactos/win32ss/gdi/ntgdi/freetype.c

index e6511de..14e41d5 100644 (file)
@@ -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);