bitmap: Changes to 'master'

Alan Coopersmith alanc at kemper.freedesktop.org
Mon Jan 5 09:44:10 PST 2015


 Bitmap.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit dacae58710f7033d5295c50cf6262783350e938d
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Mon Dec 29 18:28:00 2014 -0800

    Stop memory leak in XmuWriteBitmapDataToFile()
    
    StripFilename() allocates a new string for its result, so after we're
    done with it, free it instead of just losing the pointer to it.
    
    Fixes errors found by Oracle Parfait 1.5.1 bug checking tool:
    
    Error: Memory leak (CWE 401)
       Memory leak of pointer basename allocated with StripFilename(filename)
            at line 712 of Bitmap.c in function 'XmuWriteBitmapDataToFile'.
              basename allocated at line 691 with StripFilename(filename).
              basename leaks when i >= data_length at line 702.
    Error: Memory leak (CWE 401)
       Memory leak of pointer basename allocated with StripFilename(filename)
            at line 715 of Bitmap.c in function 'XmuWriteBitmapDataToFile'.
              basename allocated at line 691 with StripFilename(filename).
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit 8df1a843a3a9f92399113688a350873a141bf995
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Mon Dec 29 18:15:57 2014 -0800

    Stop memory leaks from XtNewString(StripFilename(filename))
    
    StripFilename() already allocates a new string for its result,
    we don't need to duplicate it and then lose the pointer to the
    first one.
    
    Fixes errors found by Oracle Parfait 1.5.1 bug checking tool:
    
    Error: Memory leak (CWE 401)
       Memory leak of pointer pointer allocated with StripFilename(filename)
            at line 1119 of Bitmap.c in function 'BWReadFile'.
              pointer allocated at line 1106 with StripFilename(filename).
              pointer leaks when StripFilename(filename) != NULL at line 1106.
    Error: Memory leak (CWE 401)
       Memory leak of pointer pointer allocated with StripFilename(filename)
            at line 1119 of Bitmap.c in function 'BWReadFile'.
              pointer allocated at line 1106 with StripFilename(filename).
    
    Error: Memory leak (CWE 401)
       Memory leak of pointer pointer allocated with StripFilename(filename)
            at line 1222 of Bitmap.c in function 'BWWriteFile'.
              pointer allocated at line 1202 with StripFilename(filename).
              pointer leaks when StripFilename(filename) != NULL at line 1202.
    Error: Memory leak (CWE 401)
       Memory leak of pointer pointer allocated with StripFilename(filename)
            at line 1222 of Bitmap.c in function 'BWWriteFile'.
              pointer allocated at line 1202 with StripFilename(filename).
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>



More information about the xorg-commit mailing list