From 5bf97b5527e2e909c836d6c9c7e8835bc9f340b3 Mon Sep 17 00:00:00 2001 From: cristy Date: Mon, 24 Jan 2011 13:21:15 +0000 Subject: [PATCH] --- ChangeLog | 4 ++++ magick/exception-private.h | 16 ++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ed6188b1..c9909697e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-01-24 6.6.7-3 Cristy + * Remove memory leack from ThrowFileException() macro (reference + http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=17908). + 2011-01-22 6.6.7-2 Cristy * Accept quoted file paths in indirect file references (e.g. @myFiles.txt). diff --git a/magick/exception-private.h b/magick/exception-private.h index 657ab15f3..f49ad976a 100644 --- a/magick/exception-private.h +++ b/magick/exception-private.h @@ -33,22 +33,30 @@ extern "C" { } #define ThrowFatalException(severity,tag) \ { \ + char \ + *message; \ + \ ExceptionInfo \ exception; \ \ GetExceptionInfo(&exception); \ + message=GetExceptionMessage(errno); \ (void) ThrowMagickException(&exception,GetMagickModule(),severity, \ - tag == (const char *) NULL ? "unknown" : tag,"`%s'", \ - GetExceptionMessage(errno)); \ + tag == (const char *) NULL ? "unknown" : tag,"`%s'",message); \ + message=DestroyString(message); \ CatchException(&exception); \ (void) DestroyExceptionInfo(&exception); \ _exit(1); \ } #define ThrowFileException(exception,severity,tag,context) \ { \ + char \ + *message; \ + \ + message=GetExceptionMessage(errno); \ (void) ThrowMagickException(exception,GetMagickModule(),severity, \ - tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context, \ - GetExceptionMessage(errno)); \ + tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context,message); \ + message=DestroyString(message); \ } #define ThrowImageException(severity,tag) \ { \ -- 2.40.0