Possible leak when reading certain PS files

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
dirving
Posts: 13
Joined: 2008-08-28T13:45:14-07:00

Possible leak when reading certain PS files

Post by dirving »

Ok, this one is driving me nuts and it happens to be the last leak that I've found (or at least the last one my code triggers). Valgrind reports:

==8778== 940 (220 direct, 720 indirect) bytes in 5 blocks are definitely lost in loss record 14 of 20
==8778== at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==8778== by 0x4206C25: AcquireMagickMemory (memory.c:337)
==8778== by 0x42557BE: NewSplayTree (splay-tree.c:1127)
==8778== by 0x421AF4B: SetImageProperty (property.c:3047)
==8778== by 0x4173FFB: ReadImage (constitute.c:624)
==8778== by 0x400D764: ???
==8778== by 0x4173C0F: ReadImage (constitute.c:441)
==8778== by 0x40BF03B: MagickReadImage (magick-image.c:7533)

when I perform certain operations on a level 3 EPS file. I've only been able to trace it so far to ps.c. The leak seems to occur when ImageMagick creates the temporary holder file and call ReadImage on that file. I'm totally lost on this one since I have no idea why the image->properties splay tree wouldn't be deallocated along with the rest of the image.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possible leak when reading certain PS files

Post by magick »

Post a URL to one of your images and the command we are using. As always, we need to reproduce the problem before we can be of much help.
dirving
Posts: 13
Joined: 2008-08-28T13:45:14-07:00

Re: Possible leak when reading certain PS files

Post by dirving »

No problem... One of the images that produces this error is:

http://wbd.wbdtest.com/chicon-sm.eps
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Possible leak when reading certain PS files

Post by magick »

We have a fix for the memory leak you reported. It will be available sometime tomorrow. Thanks.
Post Reply