File ImageMagick-CVE-2019-16713.patch of Package ImageMagick.30356

diff --git a/coders/dot.c b/coders/dot.c
index a9410aa9fc..47e9263528 100644
--- a/coders/dot.c
+++ b/coders/dot.c
@@ -129,10 +129,7 @@ static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception)
   image=AcquireImage(image_info,exception);
   status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
   if (status == MagickFalse)
-    {
-      image=DestroyImageList(image);
-      return((Image *) NULL);
-    }
+    return(DestroyImageList(image));
   read_info=CloneImageInfo(image_info);
   SetImageInfoBlob(read_info,(void *) NULL,0);
   (void) CopyMagickString(read_info->magick,"SVG",MagickPathExtent);
@@ -147,7 +144,7 @@ static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception)
   if (graph == (graph_t *) NULL)
     {
       (void) RelinquishUniqueFileResource(read_info->filename);
-      return ((Image *) NULL);
+      return(DestroyImageList(image));
     }
   option=GetImageOption(image_info,"dot:layout-engine");
   if (option == (const char *) NULL)
@@ -157,6 +154,7 @@ static Image *ReadDOTImage(const ImageInfo *image_info,ExceptionInfo *exception)
   gvRenderFilename(graphic_context,graph,(char *) "svg",read_info->filename);
   gvFreeLayout(graphic_context,graph);
   agclose(graph);
+  image=DestroyImageList(image);
   /*
     Read SVG graph.
   */

openSUSE Build Service is sponsored by