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:
2e561c3
)
ast-build: don't leak on OOM in BoolVarCreate
author
Ran Benita
<ran234@gmail.com>
Sun, 11 May 2014 06:47:56 +0000
(09:47 +0300)
committer
Ran Benita
<ran234@gmail.com>
Sun, 11 May 2014 06:47:56 +0000
(09:47 +0300)
Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/ast-build.c
patch
|
blob
|
history
diff --git
a/src/xkbcomp/ast-build.c
b/src/xkbcomp/ast-build.c
index
11bc091
..
2a28436
100644
(file)
--- a/
src/xkbcomp/ast-build.c
+++ b/
src/xkbcomp/ast-build.c
@@
-303,8
+303,15
@@
VarCreate(ExprDef *name, ExprDef *value)
VarDef *
BoolVarCreate(xkb_atom_t ident, bool set)
{
- return VarCreate((ExprDef *) ExprCreateIdent(ident),
- (ExprDef *) ExprCreateBoolean(set));
+ ExprDef *name, *value;
+ if (!(name = ExprCreateIdent(ident))) {
+ return NULL;
+ }
+ if (!(value = ExprCreateBoolean(set))) {
+ FreeStmt((ParseCommon *) name);
+ return NULL;
+ }
+ return VarCreate(name, value);
}
InterpDef *