status=WriteImage(blob_info,image,exception);
*length=image->blob->length;
blob=DetachBlob(image->blob);
- if (status == MagickFalse)
+ if (blob == (void *) NULL)
+ blob_info->blob=RelinquishMagickMemory(blob_info->blob);
+ else if (status == MagickFalse)
blob=RelinquishMagickMemory(blob);
else
blob=ResizeQuantumMemory(blob,*length+1,sizeof(unsigned char));
status=WriteImages(clone_info,images,images->filename,exception);
*length=images->blob->length;
blob=DetachBlob(images->blob);
- if (status == MagickFalse)
+ if (blob == (void *) NULL)
+ clone_info->blob=RelinquishMagickMemory(clone_info->blob);
+ else if (status == MagickFalse)
blob=RelinquishMagickMemory(blob);
else
blob=ResizeQuantumMemory(blob,*length+1,sizeof(unsigned char));