Menu

#497 memory leak in cut.c

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

Here is the critical code : (in cut.c)

 if ( (palette=AllocateImage(clone_info))==NULL ) goto NoPalette;//403
  status=OpenBlob(clone_info,palette,ReadBinaryBlobMode,exception);
  if (status == False)
    {
    ErasePalette:
      DestroyImage(palette);
      palette=NULL;
      goto NoPalette;
    }

...
      if (EOFBlob(image))
        ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);//431
...
      if (!AllocateImageColormap(image,image->colors)) goto NoMemory;//435
...
      if (EOFBlob(image))
        ThrowReaderException(CorruptImageError,UnexpectedEndOfFile,image);//471
...

Line 431,435,471 do not free memory about palette, 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 15203:fa4fd64afa7a. Thanks for the report!

     

Log in to post a comment.

MongoDB Logo MongoDB