Skip to content

Commit 3358f06

Browse files
author
Dirk Lemstra
committed
Fixed memory leak when creating nested exceptions in Magick++.
1 parent 85cc344 commit 3358f06

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Diff for: ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2017-02-09 6.9.7-8 Dirk Lemstra <dirk@lem.....org>
2+
* Fixed memory leak when creating nested exceptions in Magick++ (reference
3+
https://www.imagemagick.org/discourse-server/viewtopic.php?f=23&p=142634)
4+
15
2017-02-06 6.9.7-8 Cristy <quetzlzacatenango@image...>
26
* Eliminate bogus assertion (reference
37
https://github.com/ImageMagick/ImageMagick/issues/372).

Diff for: Magick++/lib/Exception.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -852,12 +852,18 @@ MagickPPExport void Magick::throwException(ExceptionInfo *exception_,
852852
exception_->description) != 0))
853853
{
854854
if (nestedException == (Exception *) NULL)
855-
nestedException=createException(p);
855+
{
856+
nestedException=createException(p);
857+
q=nestedException;
858+
}
856859
else
857860
{
858-
q=createException(p);
859-
nestedException->nested(q);
860-
nestedException=q;
861+
Exception
862+
*r;
863+
864+
r=createException(p);
865+
q->nested(r);
866+
q=r;
861867
}
862868
}
863869
}

0 commit comments

Comments
 (0)