From 8b1d64e2322d13aa4a2e5f6d3cc332f65cdca656 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 20 Oct 2018 09:34:38 +0200 Subject: [PATCH] Fixed leaking the new cache list when exiting. --- MagickCore/magic.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MagickCore/magic.c b/MagickCore/magic.c index 23beb2666..15e946f2b 100644 --- a/MagickCore/magic.c +++ b/MagickCore/magic.c @@ -790,4 +790,11 @@ MagickPrivate void MagicComponentTerminus(void) magic_list=DestroyLinkedList(magic_list,DestroyMagicElement); UnlockSemaphoreInfo(magic_list_semaphore); RelinquishSemaphoreInfo(&magic_list_semaphore); + if (magic_cache_semaphore == (SemaphoreInfo *) NULL) + ActivateSemaphoreInfo(&magic_cache_semaphore); + LockSemaphoreInfo(magic_cache_semaphore); + if (magic_cache != (LinkedListInfo *) NULL) + magic_cache=DestroyLinkedList(magic_cache,(void *(*)(void *)) NULL); + UnlockSemaphoreInfo(magic_cache_semaphore); + RelinquishSemaphoreInfo(&magic_cache_semaphore); } -- 2.40.0