Skip to content

Commit 5f21230

Browse files
author
Cristy
committed
https://github.com/ImageMagick/ImageMagick/issues/1616
1 parent 63bf487 commit 5f21230

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: MagickWand/mogrify.c

+3
Original file line numberDiff line numberDiff line change
@@ -7908,6 +7908,8 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
79087908
&distortion,exception);
79097909
if (difference_image == (Image *) NULL)
79107910
break;
7911+
reconstruct_image=DestroyImage(reconstruct_image);
7912+
image=DestroyImage(image);
79117913
if (*images != (Image *) NULL)
79127914
*images=DestroyImageList(*images);
79137915
*images=difference_image;
@@ -8295,6 +8297,7 @@ WandExport MagickBooleanType MogrifyImageList(ImageInfo *image_info,
82958297
q=GetImageFromList(*images,index-1);
82968298
if (q == (Image *) NULL)
82978299
{
8300+
p=DestroyImage(p);
82988301
(void) ThrowMagickException(exception,GetMagickModule(),
82998302
OptionError,"NoSuchImage","`%s'",argv[i+1]);
83008303
status=MagickFalse;

Diff for: MagickWand/operation.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -4171,7 +4171,10 @@ WandPrivate MagickBooleanType CLIListOperatorImages(MagickCLI *cli_wand,
41714171
{
41724172
index_image=GetImageFromList(_images,index-1);
41734173
if (index_image == (Image *) NULL)
4174-
CLIWandExceptArgBreak(OptionError,"NoSuchImage",option,arg1);
4174+
{
4175+
insert_image=DestroyImage(insert_image);
4176+
CLIWandExceptArgBreak(OptionError,"NoSuchImage",option,arg1);
4177+
}
41754178
InsertImageInList(&index_image,insert_image);
41764179
}
41774180
_images=GetFirstImageInList(index_image);

0 commit comments

Comments
 (0)