]> granicus.if.org Git - imagemagick/commitdiff
Fixed use of relinquish flag in ExceptionInfo.
authordirk <dirk@git.imagemagick.org>
Sat, 19 Apr 2014 18:50:49 +0000 (18:50 +0000)
committerdirk <dirk@git.imagemagick.org>
Sat, 19 Apr 2014 18:50:49 +0000 (18:50 +0000)
MagickCore/exception.c

index 3929ba6e3800d26fc7d0affba10776e712a50cc7..b3a5e1e97ed7b3ed57c9cbc789c963dd55ba93c8 100644 (file)
@@ -417,16 +417,23 @@ MagickExport ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception)
     ActivateSemaphoreInfo(&exception->semaphore);
   LockSemaphoreInfo(exception->semaphore);
   exception->severity=UndefinedException;
-  if (exception->exceptions != (void *) NULL)
-    exception->exceptions=(void *) DestroyLinkedList((LinkedListInfo *)
-      exception->exceptions,DestroyExceptionElement);
-  relinquish=exception->relinquish;
   if (exception->relinquish != MagickFalse)
-    exception->signature=(~MagickSignature);
+    {
+      exception->signature=(~MagickSignature);
+      if (exception->exceptions != (void *) NULL)
+        exception->exceptions=(void *) DestroyLinkedList((LinkedListInfo *)
+          exception->exceptions,DestroyExceptionElement);
+    }
+  else if (exception->exceptions != (void *) NULL)
+    ClearLinkedList((LinkedListInfo *) exception->exceptions,
+      DestroyExceptionElement);
+  relinquish=exception->relinquish;
   UnlockSemaphoreInfo(exception->semaphore);
-  RelinquishSemaphoreInfo(&exception->semaphore);
   if (relinquish != MagickFalse)
-    exception=(ExceptionInfo *) RelinquishMagickMemory(exception);
+    {
+      RelinquishSemaphoreInfo(&exception->semaphore);
+      exception=(ExceptionInfo *) RelinquishMagickMemory(exception);
+    }
   return(exception);
 }
 \f