From 26372f5d505988e9a2cfc984af1a93ca0c264017 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Thu, 13 Feb 2025 08:19:19 +0000 Subject: [PATCH] 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. --- graphics/grTkCommon.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/graphics/grTkCommon.c b/graphics/grTkCommon.c index acba90e0..56b767bf 100644 --- a/graphics/grTkCommon.c +++ b/graphics/grTkCommon.c @@ -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 */