Patch for memory leak in ImageMagick 6.3.5-10

Announcements pertaining to ImageMagick, or ImageMagick related software. This list is moderated. No discussions here, instead post to the users group instead.
Post Reply
User avatar
magick
Site Admin
Posts: 11100
Joined: 2003-05-31T11:32:55-07:00

Patch for memory leak in ImageMagick 6.3.5-10

Post by magick » 2007-09-25T11:02:39-07:00

Remove
  • *destination=(char *) NULL;
in CloneString() of magick/string.c to fix a memory leak a user identified in ImageMagick 6.3.5-10. The results should look like this:

Code: Select all

  if (source == (const char *) NULL)
    {
      if (*destination != (char *) NULL)
        *destination=DestroyString(*destination);
      return(*destination);
    }
  if (*destination == (char *) NULL)
    {
      *destination=AcquireString(source);
      return(*destination);
    }
  length=strlen(source);
  if (~length < MaxTextExtent)
    ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString");
  *destination=(char *) ResizeQuantumMemory(*destination,length+MaxTextExtent,
    sizeof(*destination));

Post Reply