projects
/
platform
/
upstream
/
libxkbcommon.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e72fc29
)
xkbcomp: Fail when converting rules to components returns an error
author
Dan Nicholson
<dbn.lists@gmail.com>
Sat, 4 Apr 2009 16:51:33 +0000
(09:51 -0700)
committer
Dan Nicholson
<dbn.lists@gmail.com>
Sat, 4 Apr 2009 16:51:33 +0000
(09:51 -0700)
XkbcRF_GetComponents was returning an error but leaving the generated
components alone. This ensures that the broken XkbComponentNamesPtr is
freed and the error is passed up to the caller.
src/xkbcomp/xkbcomp.c
patch
|
blob
|
history
diff --git
a/src/xkbcomp/xkbcomp.c
b/src/xkbcomp/xkbcomp.c
index
790f1ae
..
bab4403
100644
(file)
--- a/
src/xkbcomp/xkbcomp.c
+++ b/
src/xkbcomp/xkbcomp.c
@@
-86,8
+86,17
@@
XkbComponentsFromRules(const char *rulesPath, const XkbRF_VarDefsPtr defs)
goto unwind_rules;
}
- if (!XkbcRF_GetComponents(rules, defs, names))
+ if (!XkbcRF_GetComponents(rules, defs, names)) {
+ _XkbFree(names->keymap);
+ _XkbFree(names->keycodes);
+ _XkbFree(names->types);
+ _XkbFree(names->compat);
+ _XkbFree(names->symbols);
+ _XkbFree(names->geometry);
+ _XkbFree(names);
+ names = NULL;
ERROR("no components returned from XKB rules \"%s\"\n", rulesPath);
+ }
unwind_rules:
XkbcRF_Free(rules, True);