[PATCH v2 xserver 0/2] Fix for XKB geometry leaks when mapping changes

Rami Ylimäki rami.ylimaki at vincit.fi
Wed Mar 30 06:47:29 PDT 2011

Running "setxkbmap" repeatedly to change the keyboard mapping may lead
to leaking of geometry related XKB data. The "setxkbmap" command does
XkbGetKbdByName request, which copies keymap using XkbCopyKeymap, but
the copying doesn't always release allocated pointers in _XkbCopyGeom.

This version contains fixes based on review comments.

Previously the _XkbGeomRealloc function was introduced as a static
function that was only used in _XkbCopyGeom. The function has now been
made public and is also used by _XkbGeomAlloc.

Peter Hutterer:

- Use enum to define how array is cleared.
- Don't use assertions, just fail the geometry when there are

Rami Ylimäki (2):
  xkb: Introduce helper function to handle similar reallocations.
  xkb: Prevent leaking of XKB geometry information on copy.

 xkb/XKBGAlloc.c |   64 ++++++++++++++++++++++++---
 xkb/xkbUtils.c  |  129 ++++++++++++++++--------------------------------------
 xkb/xkbgeom.h   |   20 +++++++++
 3 files changed, 114 insertions(+), 99 deletions(-)

More information about the xorg-devel mailing list