| Summary: |
XKeysymToString causes leaks for lookups of unnamed keys in Unicode range |
| Product: |
xorg
|
Reporter: |
Alan Coopersmith <alan.coopersmith> |
| Component: |
Lib/Xlib | Assignee: |
Xorg Project Team <xorg-team> |
| Status: |
RESOLVED
INVALID
|
QA Contact: |
Xorg Project Team <xorg-team> |
| Severity: |
major
|
|
|
| Priority: |
high
|
CC: |
kimmo.hamalainen
|
| Version: |
7.0 (2005.12) | Keywords: |
love |
| Hardware: |
All | |
|
| OS: |
All | |
|
| Whiteboard: |
2011BRB_Reviewed |
|
i915 platform:
|
|
i915 features:
|
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
The XKeysymToString man page says: The returned string is in a static area and must not be modified. so no well-behaved other library or program ever calls free() on the returned value. However, if XKeysymToString can't find a keysym name and has to make one up for a keycode in the range 0x01000100 - 0x0110ffff, then it mallocs a new string, writes in a name and returns it. Since it doesn't do anything else, and the calling program doesn't know it needs to clean up, it will leak. If it looks up the keysym multiple times, it will allocate new memory each time and leak more memory each time. Xlib should probably store the newly created name in it's hash table with other keysyms, so that future lookups get the same pointer each time.