From: Chris Liddell <chris.liddell@artifex.com>
Date: Wed, 14 Feb 2024 14:03:22 +0000
Subject: Fix compiler warning in optimised build
Origin: https://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=147e5abd63d82c9ec3587c6f67a5d8ec7dc38e61

We were declaring a local memory pointer only used in a debug build, use the
pointer from the structure directly instead.
---
 base/gsicc_cache.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/base/gsicc_cache.c b/base/gsicc_cache.c
index c3026c1364c5..c1fe3082184c 100644
--- a/base/gsicc_cache.c
+++ b/base/gsicc_cache.c
@@ -606,15 +606,14 @@ gsicc_remove_link(gsicc_link_t *link)
 {
     gsicc_link_t *curr, *prev;
     gsicc_link_cache_t *icc_link_cache = link->icc_link_cache;
-    const gs_memory_t *memory = link->memory;
 
-    if_debug2m(gs_debug_flag_icc, memory,
+    if_debug2m(gs_debug_flag_icc, link->memory,
                "[icc] Removing link = "PRI_INTPTR" memory = "PRI_INTPTR"\n",
-               (intptr_t)link, (intptr_t)memory);
+               (intptr_t)link, (intptr_t)link->memory);
     /* NOTE: link->ref_count must be 0: assert ? */
     gx_monitor_enter(icc_link_cache->lock);
     if (link->ref_count != 0) {
-      if_debug2m(gs_debug_flag_icc, memory, "link at "PRI_INTPTR" being removed, but has ref_count = %d\n", (intptr_t)link, link->ref_count);
+      if_debug2m(gs_debug_flag_icc, link->memory, "link at "PRI_INTPTR" being removed, but has ref_count = %d\n", (intptr_t)link, link->ref_count);
     }
     curr = icc_link_cache->head;
     prev = NULL;
-- 
2.45.2

