image->storage_class=PseudoClass;
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
- return(DestroyImageList(image));
+ {
+ sixel_pixels=(unsigned char *) RelinquishMagickMemory(sixel_pixels);
+ sixel_palette=(unsigned char *) RelinquishMagickMemory(sixel_palette);
+ return(DestroyImageList(image));
+ }
if (AcquireImageColormap(image,image->colors, exception) == MagickFalse)
{
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
count=ReadBlob(image,image_size,tim_data);
if (count != (ssize_t) (image_size))
- ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+ {
+ tim_data=(unsigned char *) RelinquishMagickMemory(tim_data);
+ ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+ }
tim_pixels=tim_data;
/*
Initialize image structure.
break;
}
default:
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ tim_data=(unsigned char *) RelinquishMagickMemory(tim_data);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
}
if (image->storage_class == PseudoClass)
(void) SyncImage(image,exception);