From: cristy Date: Wed, 22 Aug 2012 16:30:29 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5085 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e50f9e07a40f06a44868b63e38d862b50386550;p=imagemagick --- diff --git a/MagickCore/blob.c b/MagickCore/blob.c index 0a38244a6..e2506fae8 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -1543,17 +1543,13 @@ MagickExport unsigned char *ImageToBlob(const ImageInfo *image_info, image->blob->exempt=MagickTrue; *image->filename='\0'; status=WriteImage(blob_info,image,exception); - if (status != MagickFalse) - { - blob_info->blob=(unsigned char *) - RelinquishMagickMemory(blob_info->blob); - blob_info=DestroyImageInfo(blob_info); - return((unsigned char *) NULL); - } *length=image->blob->length; blob=DetachBlob(image->blob); - blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1, - sizeof(*blob)); + if (status == MagickFalse) + blob=(unsigned char *) RelinquishMagickMemory(blob); + else + blob=(unsigned char *) ResizeQuantumMemory(blob,*length+1, + sizeof(*blob)); } } else