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

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.2-0/coders/ashlar.c
===================================================================
--- ImageMagick-7.1.2-0.orig/coders/ashlar.c
+++ ImageMagick-7.1.2-0/coders/ashlar.c
@@ -639,13 +639,13 @@ static Image *ASHLARImage(ImageInfo *ima
           *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)
@@ -653,6 +653,7 @@ static Image *ASHLARImage(ImageInfo *ima
               geometry.y/2.0);
             (void) CloneString(&draw_info->geometry,offset);
             (void) AnnotateImage(ashlar_image,draw_info,exception);
+            draw_info=DestroyDrawInfo(draw_info);
           }
       }
     if (((ssize_t) tiles[i].width+tiles[i].x) > (ssize_t) extent.width)
openSUSE Build Service is sponsored by