File ImageMagick-CVE-2018-5246.patch of Package ImageMagick.8212

diff --git a/coders/pattern.c b/coders/pattern.c
index bb22c1604f..a5893c70e7 100644
--- a/coders/pattern.c
+++ b/coders/pattern.c
@@ -977,7 +977,10 @@ static Image *ReadPATTERNImage(const ImageInfo *image_info,
         break;
       }
   if (blob == (const void *) NULL)
-    ThrowReaderException(OptionError,"UnrecognizedImageFormat");
+    {
+      blob_info=DestroyImageInfo(blob_info);
+      ThrowReaderException(OptionError,"UnrecognizedImageFormat");
+    }
   image=BlobToImage(blob_info,blob,extent,exception);
   if (image_info->size != (char *) NULL)
     {