Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • X xmodmap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorg
  • app
  • xmodmap
  • Merge requests
  • !3

Stop memory leaks

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Alan Coopersmith requested to merge alanc/xmodmap:parfait into master Apr 17, 2022
  • Overview 0
  • Commits 2
  • Pipelines 1
  • Changes 2

Resolves issues reported by Oracle Parfait static analyzer:

Error: Memory leak
   Memory leak [memory-leak] (CWE 401):
      Memory leak of pointer pointer allocated with XGetKeyboardMapping(...)
        at line 251 of app/xmodmap/exec.c in function 'PrintModifierMapping'.
          pointer allocated at line 222 with XGetKeyboardMapping(...)

Error: Memory leak
   Memory leak [memory-leak] (CWE 401):
      Memory leak of pointer kclist allocated with malloc((n * 1))
        at line 698 of app/xmodmap/handle.c in function 'do_remove'.
          kclist allocated at line 662 with malloc((n * 1))
          kclist leaks when num_kcs != 0 at line 676
              and (j + 1) >= num_kcs at line 687
              and (nc + num_kcs) > tot at line 691
              and (num_kcs - 1) < 0 at line 701.
   Memory leak [memory-leak] (CWE 401):
      Memory leak of pointer kclist allocated with malloc((n * 1))
        at line 711 of app/xmodmap/handle.c in function 'do_remove'.
          kclist allocated at line 662 with malloc((n * 1))
          kclist leaks when (i + 1) >= n at line 672.
Error: Memory leak
   Memory leak [memory-leak] (CWE 401):
      Memory leak of pointer kclist allocated with realloc(kclist, (tot * 1))
        at line 711 of app/xmodmap/handle.c in function 'do_remove'.
          kclist allocated at line 693 with realloc(kclist, (tot * 1))
          kclist leaks when (num_kcs - 1) < 0 at line 701
              and (i + 1) >= n at line 672.
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: parfait