gtTkCommon.c: SUPPORT_DIRECT_MALLOC around function pointer use of legacy malloc

Just in case I also modify the allocation to ensure it was also performed
via exactly the same method.
This commit is contained in:
Darryl L. Miles
2025-10-29 21:39:44 +00:00
parent f173c0ebda
commit 6022eead50
+9 -1
View File
@@ -209,9 +209,17 @@ grTkDefineCursor(glyphs)
return;
}
#ifdef SUPPORT_DIRECT_MALLOC
glyphcache = (CursorCache *)malloc(sizeof(CursorCache));
#else
glyphcache = (CursorCache *)mallocMagic(sizeof(CursorCache));
#endif
g->gr_cache = (ClientData)glyphcache;
g->gr_free = freeMagic;
#ifdef SUPPORT_DIRECT_MALLOC
g->gr_free = free;
#else
g->gr_free = freeMagicLegacy;
#endif
/* Find the foreground and background colors of the glyph */