dib_colormap=(unsigned char *) AcquireQuantumMemory((size_t)
(1UL << dib_info.bits_per_pixel),4*sizeof(*dib_colormap));
if (dib_colormap == (unsigned char *) NULL)
- ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ pixels=(unsigned char *) RelinquishMagickMemory(pixels);
+ ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+ }
q=dib_colormap;
for (i=0; i < (ssize_t) MagickMin(image->colors,dib_info.number_colors); i++)
{