Memory leak in Image::ping()?
Posted: 2007-12-07T13:14:34-07:00
I'm using the Suse rpm 6.3.0.0-27.8 for Magick++, and valgrind is reporting a memory leak, and I want to know if my code is right before making a bug report.
My code intends to simply get the dimensions of a an image file, and detect CMYK colourspace, and this is the code that does it:
Magick::Blob blob;
Magick::Image image;
try {
image.ping(sPath);
} catch (exception &ex) {
g_pLog->LogLine(ex.what());
return FALSE;
}
if (image.columns() <= 0 || image.rows() <= 0) return FALSE;
nWidth = image.columns();
nHeight = image.rows();
bCMYK = image.colorSpace() == Magick::CMYKColorspace;
That is all the Magick calls in my code. Valgrind alerts to this memory leak:
==2381== at 0x4C22AC6: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==2381== by 0x5398AF8: GetCacheInfo (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x5411567: AllocateImage (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x1579A0DC: (within /usr/lib64/ImageMagick-6.3.0/modules-Q16/coders/jpeg.so)
==2381== by 0x53B643C: ReadImage (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x545C07A: ReadStream (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x53B7321: PingImage (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x4E78317: Magick::Image::ping(std::string const&) (in /usr/lib64/libMagick++.so.10.0.5)
Is this a real bug, or is there something wrong w/my code?
My code intends to simply get the dimensions of a an image file, and detect CMYK colourspace, and this is the code that does it:
Magick::Blob blob;
Magick::Image image;
try {
image.ping(sPath);
} catch (exception &ex) {
g_pLog->LogLine(ex.what());
return FALSE;
}
if (image.columns() <= 0 || image.rows() <= 0) return FALSE;
nWidth = image.columns();
nHeight = image.rows();
bCMYK = image.colorSpace() == Magick::CMYKColorspace;
That is all the Magick calls in my code. Valgrind alerts to this memory leak:
==2381== at 0x4C22AC6: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so)
==2381== by 0x5398AF8: GetCacheInfo (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x5411567: AllocateImage (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x1579A0DC: (within /usr/lib64/ImageMagick-6.3.0/modules-Q16/coders/jpeg.so)
==2381== by 0x53B643C: ReadImage (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x545C07A: ReadStream (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x53B7321: PingImage (in /usr/lib64/libMagick.so.10.0.5)
==2381== by 0x4E78317: Magick::Image::ping(std::string const&) (in /usr/lib64/libMagick++.so.10.0.5)
Is this a real bug, or is there something wrong w/my code?