From 960de60924208e2fceff6d118c0bcec38dae627b Mon Sep 17 00:00:00 2001
From: maminjie <maminjie1@huawei.com>
Date: Sat, 19 Sep 2020 16:00:58 +0800
Subject: [PATCH] ProcessMSLScript(): Release msl_image if OpenBlob fails.
 (CVE-2018-18544)

refers to http://hg.code.sf.net/p/graphicsmagick/code/rev/31349424878d
---
 coders/msl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/coders/msl.c b/coders/msl.c
index 5add044..9e99629 100644
--- a/coders/msl.c
+++ b/coders/msl.c
@@ -4540,6 +4540,7 @@ ProcessMSLScript(const ImageInfo *image_info,Image **image,
   status=OpenBlob(image_info,msl_image,ReadBinaryBlobMode,exception);
   if (status == False)
     {
+      DestroyImage(msl_image);
       ThrowException(exception,FileOpenError,UnableToOpenFile,
                      msl_image->filename);
       return(False);
-- 
2.23.0

