File ImageMagick-CVE-2026-25637.patch of Package ImageMagick.42998

From 30ce0e8efbd72fd6b50ed3a10ae22f57c8901137 Mon Sep 17 00:00:00 2001
From: Dirk Lemstra <dirk@lemstra.org>
Date: Wed, 4 Feb 2026 17:19:53 +0100
Subject: [PATCH] Fixed possible memory leak (GHSA-gm37-qx7w-p258)

---
 coders/ashlar.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: ImageMagick-7.1.0-9/coders/ashlar.c
===================================================================
--- ImageMagick-7.1.0-9.orig/coders/ashlar.c
+++ ImageMagick-7.1.0-9/coders/ashlar.c
@@ -642,13 +642,13 @@ static MagickBooleanType WriteASHLARImag
           *label,
           offset[MagickPathExtent];
 
-        DrawInfo
-          *draw_info = CloneDrawInfo(image_info,(DrawInfo *) NULL);
-
         label=InterpretImageProperties((ImageInfo *) image_info,tile_image,
           value,exception);
         if (label != (const char *) NULL)
           {
+            DrawInfo
+              *draw_info = CloneDrawInfo(image_info,(DrawInfo *) NULL);
+
             (void) CloneString(&draw_info->text,label);
             draw_info->pointsize=1.8*geometry.y;
             (void) FormatLocaleString(offset,MagickPathExtent,"%+g%+g",(double)
@@ -656,6 +656,7 @@ static MagickBooleanType WriteASHLARImag
               geometry.y/2.0);
             (void) CloneString(&draw_info->geometry,offset);
             (void) AnnotateImage(ashlar_image,draw_info,exception);
+            draw_info=DestroyDrawInfo(draw_info);
           }
       }
     if ((tiles[i].width+tiles[i].x) > extent.width)
openSUSE Build Service is sponsored by