Skip to content

Commit

Permalink
Fixed possible memory leak reported in #1206
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Lemstra committed Jul 14, 2018
1 parent b67f173 commit 256825d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions coders/tiff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3128,6 +3128,7 @@ static MagickBooleanType TIFFWritePhotoshopLayers(Image* image,
layers=AcquireStringInfo(profile.quantum);
if (layers == (StringInfo *) NULL)
{
base_image=DestroyImage(base_image);
clone_info=DestroyImageInfo(clone_info);
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
image->filename);
Expand All @@ -3137,6 +3138,7 @@ static MagickBooleanType TIFFWritePhotoshopLayers(Image* image,
custom_stream=TIFFAcquireCustomStreamForWriting(&profile,exception);
if (custom_stream == (CustomStreamInfo *) NULL)
{
base_image=DestroyImage(base_image);
clone_info=DestroyImageInfo(clone_info);
layers=DestroyStringInfo(layers);
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
Expand All @@ -3145,6 +3147,7 @@ static MagickBooleanType TIFFWritePhotoshopLayers(Image* image,
blob=CloneBlobInfo((BlobInfo *) NULL);
if (blob == (BlobInfo *) NULL)
{
base_image=DestroyImage(base_image);
clone_info=DestroyImageInfo(clone_info);
layers=DestroyStringInfo(layers);
custom_stream=DestroyCustomStreamInfo(custom_stream);
Expand Down

0 comments on commit 256825d

Please sign in to comment.