Menu

#495 memory leak in hdf.c

v1.0_(example)
closed-fixed
None
5
2017-09-30
2017-09-25
bestshow
No
  hdf_pixels=MagickAllocateMemory(unsigned char *, //213
      packet_size*image->columns*image->rows);
    if (hdf_pixels == (unsigned char *) NULL)
      ThrowReaderException(ResourceLimitError,MemoryAllocationFailed,image);
...
        if (!AllocateImageColormap(image,image->colors))
          ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, //226
            image);
        hdf_palette=MagickAllocateMemory(unsigned char *,768);
        if (hdf_palette == (unsigned char *) NULL)
          ThrowReaderException(ResourceLimitError,MemoryAllocationFailed, //230
            image);
...
MagickFreeMemory(hdf_pixels);

Line 226,230 do not free memory about hdf_pixels, 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 15201:8ee7cc3fd116. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB