xkbprint: Changes to 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 16:50:41 UTC 2022


 .gitlab-ci.yml |    2 -
 psgeom.c       |   82 +++++++++++++++++++++++++++++++++++++++++----------------
 2 files changed, 60 insertions(+), 24 deletions(-)

New commits:
commit 69deaf13057d3a8b9c01350e2cdfc40080f5433a
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Apr 16 11:56:06 2022 -0700

    gitlab CI: stop requiring Signed-off-by in commits
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

commit f586ae4a0a8d081c46f10f4cb4c27840d611edec
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sat Apr 16 11:51:37 2022 -0700

    Stop leaking XkbAtomGetString allocations
    
    XkbAtomGetString is a wrapper around XGetAtomName, and like XGetAtomName
    returns a newly allocated string (or NULL) on every call, so we should
    free those strings when done instead of leaking them.
    
    Reported by Oracle Parfait static analyser:
    
    Error: Memory leak
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(state->dpy, state->geom->name)
            at line 720 of app/xkbprint/psgeom.c in function 'PSProlog'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 612 of app/xkbprint/psgeom.c in function 'PSProlog' with XkbAtomGetString(state->dpy, state->geom->name)
              pointer leaks when (i + 1) >= state->geom->num_colors at line 694
                  and (i + 1) >= state->geom->num_shapes at line 712.
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(state->dpy, state->geom->name)
            at line 720 of app/xkbprint/psgeom.c in function 'PSProlog'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 657 of app/xkbprint/psgeom.c in function 'PSProlog' with XkbAtomGetString(state->dpy, state->geom->name)
              pointer leaks when (i + 1) >= state->geom->num_colors at line 694
                  and (i + 1) >= state->geom->num_shapes at line 712.
    
    Error: Memory leak
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer name allocated with XkbAtomGetString(state->dpy, geom->name)
            at line 962 of app/xkbprint/psgeom.c in function 'PSPageTrailer'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              name allocated at line 845 of app/xkbprint/psgeom.c in function 'PSPageTrailer' with XkbAtomGetString(state->dpy, geom->name)
              name leaks when (p + 1) >= state->args->copies at line 926.
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer sName allocated with XkbAtomGetString(state->dpy, sAtom)
            at line 962 of app/xkbprint/psgeom.c in function 'PSPageTrailer'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              sName allocated at line 877 of app/xkbprint/psgeom.c in function 'PSPageTrailer' with XkbAtomGetString(state->dpy, sAtom)
              sName leaks when (p + 1) >= state->args->copies at line 926.
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer sName allocated with XkbAtomGetString(state->dpy, sAtom)
            at line 962 of app/xkbprint/psgeom.c in function 'PSPageTrailer'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              sName allocated at line 910 of app/xkbprint/psgeom.c in function 'PSPageTrailer' with XkbAtomGetString(state->dpy, sAtom)
              sName leaks when (p + 1) >= state->args->copies at line 926.
    
    Error: Memory leak
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer dname allocated with XkbAtomGetString(xkb->dpy, doodad.any.name)
            at line 1068 of app/xkbprint/psgeom.c in function 'PSDoodad'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              dname allocated at line 974 of app/xkbprint/psgeom.c in function 'PSDoodad' with XkbAtomGetString(xkb->dpy, doodad.any.name)
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer name allocated with XkbAtomGetString(...)
            at line 1068 of app/xkbprint/psgeom.c in function 'PSDoodad'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              name allocated at line 980 of app/xkbprint/psgeom.c in function 'PSDoodad' with XkbAtomGetString(...)
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer name allocated with XkbAtomGetString(...)
            at line 1068 of app/xkbprint/psgeom.c in function 'PSDoodad'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              name allocated at line 1044 of app/xkbprint/psgeom.c in function 'PSDoodad' with XkbAtomGetString(...)
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer name allocated with XkbAtomGetString(...)
            at line 1068 of app/xkbprint/psgeom.c in function 'PSDoodad'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              name allocated at line 1058 of app/xkbprint/psgeom.c in function 'PSDoodad' with XkbAtomGetString(...)
    
    Error: Memory leak
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(dpy, section->name)
            at line 2063 of app/xkbprint/psgeom.c in function 'PSSection'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 1907 of app/xkbprint/psgeom.c in function 'PSSection' with XkbAtomGetString(dpy, section->name)
              pointer leaks when (k + 1) >= (section->rows + <pointer arithmetic>)->num_keys at line 1936
    
      Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(dpy, shape->name)
            at line 2063 of app/xkbprint/psgeom.c in function 'PSSection'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 1945 of app/xkbprint/psgeom.c in function 'PSSection' with XkbAtomGetString(dpy, shape->name)
              pointer leaks when (k + 1) >= (section->rows + <pointer arithmetic>)->num_keys at line 1936
                  and (r + 1) >= section->num_rows at line 1925.
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(dpy, shape->name)
            at line 2063 of app/xkbprint/psgeom.c in function 'PSSection'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 1951 of app/xkbprint/psgeom.c in function 'PSSection' with XkbAtomGetString(dpy, shape->name)
              pointer leaks when (k + 1) >= (section->rows + <pointer arithmetic>)->num_keys at line 1936
                  and (r + 1) >= section->num_rows at line 1925.
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(dpy, shape->name)
            at line 2063 of app/xkbprint/psgeom.c in function 'PSSection'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 1960 of app/xkbprint/psgeom.c in function 'PSSection' with XkbAtomGetString(dpy, shape->name)
              pointer leaks when (k + 1) >= (section->rows + <pointer arithmetic>)->num_keys at line 1936
                  and (r + 1) >= section->num_rows at line 1925.
    
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer pointer allocated with XkbAtomGetString(dpy, shape->name)
            at line 2063 of app/xkbprint/psgeom.c in function 'PSSection'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              pointer allocated at line 1966 of app/xkbprint/psgeom.c in function 'PSSection' with XkbAtomGetString(dpy, shape->name)
              pointer leaks when (k + 1) >= (section->rows + <pointer arithmetic>)->num_keys at line 1936
                  and (r + 1) >= section->num_rows at line 1925.
    
    Error: Memory leak
       Memory leak [memory-leak] (CWE 401):
          Memory leak of pointer name allocated with XkbAtomGetString(...)
            at line 2131 of app/xkbprint/psgeom.c in function 'GeometryToPostScript'.
            Allocated value returned to caller at line 207 of lib/libxkbfile/src/xkbatom.c in function 'XkbAtomGetString'
              name allocated at line 2110 of app/xkbprint/psgeom.c in function 'GeometryToPostScript' with XkbAtomGetString(...)
              name leaks when name != NULL at line 2111.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>



More information about the xorg-commit mailing list