]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/904
authorCristy <urban-warrior@imagemagick.org>
Wed, 20 Dec 2017 16:44:50 +0000 (11:44 -0500)
committerCristy <urban-warrior@imagemagick.org>
Wed, 20 Dec 2017 16:44:50 +0000 (11:44 -0500)
MagickWand/montage.c

index d4263a74fcd8f078ffaddc3f23add412bafa239c..5bf6771e4459e7adbe54a14d6f2bc4430762a5a3 100644 (file)
@@ -267,6 +267,8 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info,
 { \
   if (montage_image != (Image *) NULL) \
     montage_image=DestroyImageList(montage_image); \
+  if (montage_info != (MontageInfo *) NULL) \
+    montage_info=DestroyMontageInfo(montage_info); \
   DestroyImageStack(); \
   for (i=0; i < (ssize_t) argc; i++) \
     argv[i]=DestroyString(argv[i]); \
@@ -1785,7 +1787,8 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info,
       /*
         Write image.
       */
-      (void) CopyMagickString(image_info->filename,argv[argc-1],MagickPathExtent);
+      (void) CopyMagickString(image_info->filename,argv[argc-1],
+        MagickPathExtent);
       (void) CopyMagickString(montage_image->magick_filename,argv[argc-1],
         MagickPathExtent);
       if (*montage_image->magick == '\0')
@@ -1806,7 +1809,6 @@ WandExport MagickBooleanType MontageImageCommand(ImageInfo *image_info,
           text=DestroyString(text);
         }
     }
-  montage_info=DestroyMontageInfo(montage_info);
   DestroyMontage();
   return(status != 0 ? MagickTrue : MagickFalse);
 }