Hello,
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,
*/
profile=AcquireStringInfo(length);
SetStringInfoDatum(profile,info);
info=(unsigned char *) RelinquishMagickMemory(info); // line to be added
(void) SetImageProfile(image,&text[ii].key[17],profile);
profile=DestroyStringInfo(profile);
if (image_info->verbose)
(void) printf(" Found a generic profile, type %s\n",&text[ii].key[17]);
return MagickTrue;
Thanks!
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.
Thanks
Memory leak in PNG coder
Memory leak in PNG coder
Manuel Jouglet
Mootools
Mootools
Re: Memory leak in PNG coder
We confirm the memory leak. We improved your patch a bit and will ensure it becomes part of the next ImageMagick release. Thanks.