Commit eef3af56f for imagemagick.org

commit eef3af56fbc2dc607e185b8565d695a8d8032d73
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Mon Sep 28 19:31:19 2026 -0400

    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-pj4h-g4pf-66v3

diff --git a/PerlMagick/Magick.xs b/PerlMagick/Magick.xs
index cd00cfe49..a42be249a 100644
--- a/PerlMagick/Magick.xs
+++ b/PerlMagick/Magick.xs
@@ -1362,9 +1362,11 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"comment") == 0)
         {
           for ( ; image; image=image->next)
-            (void) SetImageProperty(image,"Comment",InterpretImageProperties(
-              info ? info->image_info : (ImageInfo *) NULL,image,
-              SvPV(sval,na),exception),exception);
+            {
+              char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,SvPV(sval,na),exception);
+              (void) SetImageProperty(image,"Comment",property,exception);
+              if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+            }
           break;
         }
       if (LocaleCompare(attribute,"compression") == 0)
@@ -1730,9 +1732,11 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"label") == 0)
         {
           for ( ; image; image=image->next)
-            (void) SetImageProperty(image,"label",InterpretImageProperties(
-              info ? info->image_info : (ImageInfo *) NULL,image,
-              SvPV(sval,na),exception),exception);
+            {
+              char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,SvPV(sval,na),exception);
+              (void) SetImageProperty(image,"label",property,exception);
+              if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+            }
           break;
         }
       if (LocaleCompare(attribute,"loop") == 0)
@@ -7995,18 +7999,18 @@ Mogrify(ref,...)
         {
           if (attribute_flag[0] == 0)
             argument_list[0].string_reference=(char *) NULL;
-          (void) SetImageProperty(image,"comment",InterpretImageProperties(
-            info ? info->image_info : (ImageInfo *) NULL,image,
-            argument_list[0].string_reference,exception),exception);
+          char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,argument_list[0].string_reference,exception);
+          (void) SetImageProperty(image,"comment",property,exception);
+          if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
           break;
         }
         case 2:  /* Label */
         {
           if (attribute_flag[0] == 0)
             argument_list[0].string_reference=(char *) NULL;
-          (void) SetImageProperty(image,"label",InterpretImageProperties(
-            info ? info->image_info : (ImageInfo *) NULL,image,
-            argument_list[0].string_reference,exception),exception);
+          char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,argument_list[0].string_reference,exception);
+          (void) SetImageProperty(image,"label",property,exception);
+          if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
           break;
         }
         case 3:  /* AddNoise */
@@ -11918,9 +11922,11 @@ Montage(ref,...)
           if (LocaleCompare(attribute,"label") == 0)
             {
               for (next=image; next; next=next->next)
-                (void) SetImageProperty(next,"label",InterpretImageProperties(
-                  info ? info->image_info : (ImageInfo *) NULL,next,
-                  SvPV(ST(i),na),exception),exception);
+                {
+                  char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,next,SvPV(ST(i),na),exception);
+                  (void) SetImageProperty(next,"label",property,exception);
+                  if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+                }
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",
diff --git a/PerlMagick/quantum/quantum.xs.in b/PerlMagick/quantum/quantum.xs.in
index bd482e83a..b1b3ad1b4 100644
--- a/PerlMagick/quantum/quantum.xs.in
+++ b/PerlMagick/quantum/quantum.xs.in
@@ -1727,9 +1727,11 @@ static void SetAttribute(pTHX_ struct PackageInfo *info,Image *image,
       if (LocaleCompare(attribute,"label") == 0)
         {
           for ( ; image; image=image->next)
-            (void) SetImageProperty(image,"label",InterpretImageProperties(
-              info ? info->image_info : (ImageInfo *) NULL,image,
-              SvPV(sval,na),exception),exception);
+            {
+              char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,SvPV(sval,na),exception);
+              (void) SetImageProperty(image,"label",property,exception);
+              if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+            }
           break;
         }
       if (LocaleCompare(attribute,"loop") == 0)
@@ -8014,18 +8016,22 @@ Mogrify(ref,...)
         {
           if (attribute_flag[0] == 0)
             argument_list[0].string_reference=(char *) NULL;
-          (void) SetImageProperty(image,"comment",InterpretImageProperties(
-            info ? info->image_info : (ImageInfo *) NULL,image,
-            argument_list[0].string_reference,exception),exception);
+          {
+          char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,argument_list[0].string_reference,exception);
+          (void) SetImageProperty(image,"comment",property,exception);
+          if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+        }
           break;
         }
         case 2:  /* Label */
         {
           if (attribute_flag[0] == 0)
             argument_list[0].string_reference=(char *) NULL;
-          (void) SetImageProperty(image,"label",InterpretImageProperties(
-            info ? info->image_info : (ImageInfo *) NULL,image,
-            argument_list[0].string_reference,exception),exception);
+          {
+          char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,image,argument_list[0].string_reference,exception);
+          (void) SetImageProperty(image,"label",property,exception);
+          if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+        }
           break;
         }
         case 3:  /* AddNoise */
@@ -11941,9 +11947,11 @@ Montage(ref,...)
           if (LocaleCompare(attribute,"label") == 0)
             {
               for (next=image; next; next=next->next)
-                (void) SetImageProperty(next,"label",InterpretImageProperties(
-                  info ? info->image_info : (ImageInfo *) NULL,next,
-                  SvPV(ST(i),na),exception),exception);
+                {
+                  char *property = InterpretImageProperties(info ? info->image_info : (ImageInfo *) NULL,next,SvPV(ST(i),na),exception);
+                  (void) SetImageProperty(next,"label",property,exception);
+                  if (property != (char *) NULL) property=(char *) RelinquishMagickMemory(property);
+                }
               break;
             }
           ThrowPerlException(exception,OptionError,"UnrecognizedAttribute",