Menu

#483 Memory leak in tim.c

v1.0_(example)
closed-fixed
None
5
2017-09-30
2017-09-25
BlueKiller
No

Here is the critical code:

...
    tim_data=MagickAllocateMemory(unsigned char *,image_size);//228
    if (tim_data == (unsigned char *) NULL)
      ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
    (void) ReadBlob(image,image_size,(char *) tim_data);
    tim_pixels=tim_data;
...
    switch (bits_per_pixel)
    {
...
      default:
        ThrowReaderException(CorruptImageError,ImproperImageHeader,image)//371
    }
    if (image->storage_class == PseudoClass)
      (void) SyncImage(image);
MagickFreeMemory(tim_pixels);
...

Line 371 do not free memory about tim_data, this will cause memory leak.

Credit: ADLab of Venustech

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-30
    • status: open --> closed-fixed
    • assigned_to: Bob Friesenhahn
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2017-09-30

    This problem is fixed by Mercurial changeset 15189:53a000dfa335. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB