Skip to content

memory leak in WriteGIFImage #808

Closed
Closed
@bestshow

Description

@bestshow

Here is the critical code : (in WriteGIFImage)

  global_colormap=(unsigned char *) AcquireQuantumMemory(768UL,            //1560
    sizeof(*global_colormap));
  colormap=(unsigned char *) AcquireQuantumMemory(768UL,sizeof(*colormap));
  if ((global_colormap == (unsigned char *) NULL) ||
      (colormap == (unsigned char *) NULL))
    ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");       //1565

AcquireQuantumMemory(…) may return NULL,if one of the “global_colormap” and ”colormap” is NULL,and the other is not,this may cause memory leak error in “If statement”.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions