From: Dirk Lemstra Date: Sat, 20 Oct 2018 07:34:38 +0000 (+0200) Subject: Fixed leaking the new cache list when exiting. X-Git-Tag: 7.0.8-13~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b1d64e2322d13aa4a2e5f6d3cc332f65cdca656;p=imagemagick Fixed leaking the new cache list when exiting. --- 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); }