diff options
author | Rami Ylimäki <rami.ylimaki@vincit.fi> | 2011-03-11 14:30:49 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-03-16 15:21:41 +1000 |
commit | 5c47f8beac7f87680c6f7331483b9cf94a1dbc86 (patch) | |
tree | 29029202e6e534bc900ba45d94f19df68b09a94f /xkb/ddxLoad.c | |
parent | 6f46ae3c69c48f389560af1491ed1729ba45866f (diff) |
xkb: Release XKB component names when compiling keymap.
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb/ddxLoad.c')
-rw-r--r-- | xkb/ddxLoad.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/xkb/ddxLoad.c b/xkb/ddxLoad.c index dc3c844c9..e1020358a 100644 --- a/xkb/ddxLoad.c +++ b/xkb/ddxLoad.c @@ -447,23 +447,23 @@ XkbRMLVOtoKcCGST(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, XkbComponentNamesPtr kccg static XkbDescPtr XkbCompileKeymapForDevice(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, int need) { - XkbDescPtr xkb; + XkbDescPtr xkb = NULL; unsigned int provided; - XkbComponentNamesRec kccgst; + XkbComponentNamesRec kccgst = {0}; char name[PATH_MAX]; - if (!XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) - return NULL; - - provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need, - &xkb, name, PATH_MAX); - if ((need & provided) != need) { - if (xkb) { - XkbFreeKeyboard(xkb, 0, TRUE); - xkb = NULL; + if (XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) { + provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need, + &xkb, name, PATH_MAX); + if ((need & provided) != need) { + if (xkb) { + XkbFreeKeyboard(xkb, 0, TRUE); + xkb = NULL; + } } } + XkbFreeComponentNames(&kccgst, FALSE); return xkb; } |