Here is the critical code : (in cut.c)
if ( (palette=AllocateImage(clone_info))==NULL ) goto NoPalette;//403
status=OpenBlob(clone_info,palette,ReadBinaryBlobMode,exception);
if (status == False)
{
ErasePalette:
DestroyImage(palette);
palette=NULL;
goto NoPalette;
}
...
if (EOFBlob(image))
ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);//431
...
if (!AllocateImageColormap(image,image->colors)) goto NoMemory;//435
...
if (EOFBlob(image))
ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);//471
...
Line 431,435,471 do not free memory about palette, this will cause memory leak.
Credit: ADLab of Venustech
This problem is fixed by Mercurial changeset 15203:fa4fd64afa7a. Thanks for the report!