From 91fba13c9c8dfdaab7e98e5d3bee1b0085b2d2aa Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Sat, 21 Aug 2010 03:17:11 -0300 Subject: Fix handling of error conditions. * console-client/xkb/parser.y (key_set_action): Test actions variable. (key_set_keysym): Test keysyms instead of keys. --- console-client/xkb/parser.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'console-client/xkb') diff --git a/console-client/xkb/parser.y b/console-client/xkb/parser.y index 854ee408..36bc3a3f 100644 --- a/console-client/xkb/parser.y +++ b/console-client/xkb/parser.y @@ -1379,7 +1379,7 @@ key_set_keysym (struct key *key, group_t group, int level, symbol ks) { keysyms = realloc (keysyms, (level + 1)*sizeof(symbol)); - if (!keys) + if (!keysyms) { fprintf (stderr, "No mem\n"); exit (EXIT_FAILURE); @@ -1412,7 +1412,7 @@ key_set_action (struct key *key, group_t group, int level, xkb_action_t *action) /* Levels between 'width' and 'level' have no actions defined. */ memset (&actions[width], 0, (level - width)*sizeof(xkb_action_t *)); - if (!keys) + if (!actions) { fprintf (stderr, "No mem\n"); exit (EXIT_FAILURE); -- cgit v1.2.3