]> granicus.if.org Git - imagemagick/commitdiff
Fixed memory leak
authorDirk Lemstra <dirk@git.imagemagick.org>
Tue, 9 Jan 2018 23:09:36 +0000 (00:09 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Tue, 9 Jan 2018 23:09:36 +0000 (00:09 +0100)
Credit to OSS-Fuzz

Magick++/lib/Options.cpp

index b0b3f21526666bc0fb6d9ab62617d749815517e6..bacf348a2716affd40abf69328375c02c08c1fa4 100644 (file)
@@ -1,7 +1,7 @@
 // This may look like C code, but it is really -*- C++ -*-
 //
 // Copyright Bob Friesenhahn, 1999, 2000, 2001, 2002, 2003
-// Copyright Dirk Lemstra 2014-2016
+// Copyright Dirk Lemstra 2014-2018
 //
 // Implementation of Options
 //
@@ -394,10 +394,10 @@ void Magick::Options::magick(const std::string &magick_)
     magick_.c_str());
   GetPPException;
   SetImageInfo(_imageInfo,1,exceptionInfo);
+  ThrowPPException(_quiet);
   if ( _imageInfo->magick[0] == '\0' )
     throwExceptionExplicit(MagickCore::OptionError,"Unrecognized image format",
       magick_.c_str());
-  ThrowPPException(_quiet);
 }
 
 std::string Magick::Options::magick(void) const