Memory leak in coders/jp2.c
Posted: 2011-12-28T13:14:08-07:00
Hi,
I encountered a memory leak in the coders/jp2.c. I had sent a mail to the imagemagick-bugs mailing list. I was asked to report it here.
Here is the patch for the memory leak. This affects all versions (trunk and stable).
Regards,
Arun
I encountered a memory leak in the coders/jp2.c. I had sent a mail to the imagemagick-bugs mailing list. I was asked to report it here.
Here is the patch for the memory leak. This affects all versions (trunk and stable).
Code: Select all
Index: coders/jp2.c
===================================================================
--- coders/jp2.c (revision 6269)
+++ coders/jp2.c (working copy)
@@ -1011,6 +1011,11 @@
status=jas_image_encode(jp2_image,jp2_stream,format,options) != 0 ?
MagickTrue : MagickFalse;
(void) jas_stream_close(jp2_stream);
+ if (options)
+ {
+ free(options);
+ options = (char *) NULL;
+ }
for (i=0; i < (ssize_t) number_components; i++)
jas_matrix_destroy(pixels[i]);
jas_image_destroy(jp2_image);
Arun