hdf_pixels=MagickAllocateMemory(unsigned char *, //213
packet_size*image->columns*image->rows);
if (hdf_pixels == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
...
if (!AllocateImageColormap(image,image->colors))
ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, //226
image);
hdf_palette=MagickAllocateMemory(unsigned char *,768);
if (hdf_palette == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, //230
image);
...
MagickFreeMemory(hdf_pixels);
Line 226,230 do not free memory about hdf_pixels, this will cause memory leak.
Credit: ADLab of Venustech
This problem is fixed by Mercurial changeset 15201:8ee7cc3fd116. Thanks for the report!