Fixed memory leak when creating nested exceptions in Magick++.

This commit is contained in:
Dirk Lemstra
2017-02-09 21:53:16 +01:00
parent 9db2ee3e31
commit 425344a2b0
2 changed files with 16 additions and 5 deletions
+5 -1
View File
@@ -1,4 +1,8 @@
2017-03-07 7.0.4-9 Cristy <quetzlzacatenango@image...>
2017-02-09 7.0.4-8 Dirk Lemstra <dirk@lem.....org>
* Fixed memory leak when creating nested exceptions in Magick++ (reference
https://www.imagemagick.org/discourse-server/viewtopic.php?f=23&p=142634)
2017-02-07 7.0.4-8 Cristy <quetzlzacatenango@image...>
* Unbreak build without JPEG support (reference
https://github.com/ImageMagick/ImageMagick/pull/373).
+11 -4
View File
@@ -842,6 +842,7 @@ MagickPPExport void Magick::throwException(ExceptionInfo *exception_,
message=formatExceptionMessage(exception_);
nestedException=(Exception *) NULL;
q=(Exception *) NULL;
LockSemaphoreInfo(exception_->semaphore);
if (exception_->exceptions != (void *) NULL)
{
@@ -856,12 +857,18 @@ MagickPPExport void Magick::throwException(ExceptionInfo *exception_,
exception_->description) != 0))
{
if (nestedException == (Exception *) NULL)
nestedException=createException(p);
{
nestedException=createException(p);
q=nestedException;
}
else
{
q=createException(p);
nestedException->nested(q);
nestedException=q;
Exception
*r;
r=createException(p);
q->nested(r);
q=r;
}
}
}