memory leak in 'display'

Bertram Felgenhauer <[email protected]> Sat, 12 Feb 2011 00:04:49 +0100
Newsgroups gmane.comp.video.image-magick.bugs
Message-ID <20110211230449.GB3233@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f>
Hi,

'display' leaks memory when displaying a lot of images. The reason is
that the images are not freed properly:

wand/display.c:
[...]
        } while ((image != (Image *) NULL) && ((state & ExitState) == 0));
        /*
          Free image resources.
        */
        SetImageStack(image);
        RemoveAllImageStack();
[...]

Typically, image will be NULL here, and SetImageStack(image) will cause
all references to the image just displayed to disappear from the stack.

Just removing the SetImageStack(image); line seems to fix the leak.
However I'm not 100% certain that this is the right fix. There may be
something else that has to be done instead of the removed code.

Best regards,

Bertram

P.S. having to subscribe to a mailing list in order to report a bug
is annoying.