Page 1 of 1

Memory leak in PNG coder

Posted: 2007-06-08T13:06:31-07:00
by mootools

I found a memory leak in png.c file, function png_read_raw_profile:

the memory allocated at line:

info=(unsigned char *) AcquireMagickMemory(length);

is not always released.

we should release the memory somewhere below:

We have already read "Raw profile type,
info=(unsigned char *) RelinquishMagickMemory(info); // line to be added
(void) SetImageProfile(image,&text[ii].key[17],profile);
if (image_info->verbose)
(void) printf(" Found a generic profile, type %s\n",&text[ii].key[17]);
return MagickTrue;


Manuel - Mootools

PS: by the way, is it a correct way to suggest a correction?
Should I make the correction myself using a cvs tool or something like that?
I sometime post bug report but I am never sure that they are taken into account.

Re: Memory leak in PNG coder

Posted: 2007-06-08T14:58:42-07:00
by magick
We confirm the memory leak. We improved your patch a bit and will ensure it becomes part of the next ImageMagick release. Thanks.