Menu

#1120 Possible Memory Leak in XFontImp::rotate() Method

v1.3.7
closed-fixed
None
5
2015-01-21
2015-01-21
No

In File:
FbTk/XFontImp.cc

In Method:
XFontImp::rotate(FbTk::Orientation orient)

The Variables "vertdata" and "bitdata" get allocated with calloc, but possibly never freed.

There are if Statements to free the variables, but if the if statements don't get entered they never get freed.

The Bug was found in Version 1.3.6

Discussion

  • Mathias Gumz

    Mathias Gumz - 2015-01-21
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     In File:
     FbTk/XFontImp.cc   
    
    • status: open --> closed-fixed
    • assigned_to: Mathias Gumz
    • Group: v1.3.6 --> v1.3.7
     
  • Mathias Gumz

    Mathias Gumz - 2015-01-21

    should be ok:

    "Note that when the image is created using XCreateImage, XGetImage, or XSubImage, the destroy procedure that the XDestroyImage function calls frees both the image structure and the data pointed to by the image structure."

    that's also why we use "calloc()" there instead of something from c++: Xlib uses libc as well.

    but there is one incident where it might leak: successful created I1, unsuccessful I2. i fixed that.

    still: well found.

     

Log in to post a comment.