Possible memory leak - profile.c
Posted: 2008-12-09T19:10:16-07:00
There may be a memory leak in profile.c in the method 'GetProfilesFromResourceBlock' in ImageMagick 6.4.7-5. The variable 'profile' is declared and malloc'ed via the AquireStringInfo method and never freed. Here is the associated valgrind snippet:
==30403== 65,764 (32,864 direct, 32,900 indirect) bytes in 8 blocks are definitely lost in loss record 19 of 20
==30403== at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==30403== by 0x4210A35: AcquireMagickMemory (memory.c:337)
==30403== by 0x426CA68: AcquireStringInfo (string.c:160)
==30403== by 0x422BA3F: SetImageProfile (profile.c:1340)
==30403== by 0x400F496: ???
==30403== by 0x40123B0: ???
==30403== by 0x417EF77: ReadImage (constitute.c:572)
==30403== by 0x40BECCB: MagickReadImage (magick-image.c:7613)
==30403== 65,764 (32,864 direct, 32,900 indirect) bytes in 8 blocks are definitely lost in loss record 19 of 20
==30403== at 0x4006AEE: malloc (vg_replace_malloc.c:207)
==30403== by 0x4210A35: AcquireMagickMemory (memory.c:337)
==30403== by 0x426CA68: AcquireStringInfo (string.c:160)
==30403== by 0x422BA3F: SetImageProfile (profile.c:1340)
==30403== by 0x400F496: ???
==30403== by 0x40123B0: ???
==30403== by 0x417EF77: ReadImage (constitute.c:572)
==30403== by 0x40BECCB: MagickReadImage (magick-image.c:7613)