Possible leak when reading certain PS files
Posted: 2008-09-02T07:50:24-07:00
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.
==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.