Page 1 of 1

Memory leak in macro ThrowFileException()

Posted: 2011-01-24T02:40:45-07:00
by jeweljar
I found a memory leak for the macro ThrowFileException() in magick/exception-private.h

It might be not a big deal.
But I wrote a daemon process using ImageMagick library,
and this leak _matters_ as the daemon's life time goes by.

Here is my patch.

Code: Select all

#define ThrowFileException(exception,severity,tag,context) \
{ \
  char *emsg=GetExceptionMessage(errno); \
  (void) ThrowMagickException(exception,GetMagickModule(),severity, \
    tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context, \
    emsg); \
  DestroyString(emsg); \
}

Re: Memory leak in macro ThrowFileException()

Posted: 2011-01-24T06:21:43-07:00
by magick
Thanks for the problem alert and patch. We'll get your patch into ImageMagick 6.6.7-3 beta by sometime tomorrow.