Bug 305821

Summary: Patch for memory leak in ImageMagick 6.3.5-9
Product: [Fedora] Fedora Reporter: Cristy <fedora>
Component: ImageMagickAssignee: Norm Murray <nmurray>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 8CC: hdegoede, nmurray, triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://www.imagemagick.org
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-26 08:09:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Cristy 2007-09-25 18:39:33 UTC
There is a small memory leak when cloning strings in ImageMagick 6.3.5-9.  The
patch is already in ImageMagick 6.3.6-0 scheduled for release on September 29. 
To patch ImageMagick 6.3.5-9, remove

   *destination=(char *) NULL; 

in CloneString() of magick/string.c.  The results should look like this:

  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));

Comment 1 Norm Murray 2007-09-26 05:17:58 UTC
Thanks for the heads up. Will get this into my next build. 

Comment 2 Bug Zapper 2008-04-04 13:55:01 UTC
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
rawhide.
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 3 Hans de Goede 2008-04-26 08:09:21 UTC
Short intro: I'm a new co-maintainer of ImageMagick and as such walking through
all open bugs.

This bug is fixed in rawhide / F-9 closing.