]> granicus.if.org Git - imagemagick/commitdiff
Fixed leaking the new cache list when exiting.
authorDirk Lemstra <dirk@lemstra.org>
Sat, 20 Oct 2018 07:34:38 +0000 (09:34 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Sat, 20 Oct 2018 08:02:46 +0000 (10:02 +0200)
MagickCore/magic.c

index 23beb2666800fb68657ab751cc915419913755d0..15e946f2ba1947e31f83e532663f862c3f9b8480 100644 (file)
@@ -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);
 }