summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2012-05-09 09:56:00 -0700
committerRay Johnston <ray.johnston@artifex.com>2012-05-09 09:56:00 -0700
commit055ed5f7a69ad5cf4181cf337abf2245df668c01 (patch)
tree31ff6f39b2913b9d4b4313426ec81e1bdf9ffa2f
parentaf974d1bd4b4f0470e77d28eb0cdcb72def2de76 (diff)
Prevent reference to freed memory when freeing the profile cache.
-rw-r--r--gs/base/gsicc_profilecache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gs/base/gsicc_profilecache.c b/gs/base/gsicc_profilecache.c
index fcf01bdd7..be5ced0ca 100644
--- a/gs/base/gsicc_profilecache.c
+++ b/gs/base/gsicc_profilecache.c
@@ -66,9 +66,10 @@ static void
rc_gsicc_profile_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname)
{
gsicc_profile_cache_t *profile_cache = (gsicc_profile_cache_t * ) ptr_in;
- gsicc_profile_entry_t *curr = profile_cache->head;
+ gsicc_profile_entry_t *curr = profile_cache->head, *next;
while (curr != NULL ){
+ next = curr->next;
rc_decrement(curr->color_space, "rc_gsicc_profile_cache_free");
gs_free_object(mem->stable_memory, curr,
"rc_gsicc_profile_cache_free");