Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed memory leak when creating nested exceptions in Magick++.
  • Loading branch information
dlemstra committed Feb 9, 2017
1 parent 85cc344 commit 3358f06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
2017-02-09 6.9.7-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-06 6.9.7-8 Cristy <quetzlzacatenango@image...>
* Eliminate bogus assertion (reference
https://github.com/ImageMagick/ImageMagick/issues/372).
Expand Down
14 changes: 10 additions & 4 deletions Magick++/lib/Exception.cpp
Expand Up @@ -852,12 +852,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;
}
}
}
Expand Down

0 comments on commit 3358f06

Please sign in to comment.