From cee811c0c5eb1f4f2f83453439e380c83e12ed1b Mon Sep 17 00:00:00 2001 From: dirk Date: Sat, 19 Apr 2014 18:50:49 +0000 Subject: [PATCH] Fixed use of relinquish flag in ExceptionInfo. --- MagickCore/exception.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/MagickCore/exception.c b/MagickCore/exception.c index 3929ba6e3..b3a5e1e97 100644 --- a/MagickCore/exception.c +++ b/MagickCore/exception.c @@ -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); } -- 2.40.0