Various static analyzer fixes
authorRan Benita <ran234@gmail.com>
Sun, 13 May 2012 15:45:43 +0000 (18:45 +0300)
committername <email>
Fri, 18 May 2012 17:54:33 +0000 (20:54 +0300)
Signed-off-by: Ran Benita <ran234@gmail.com>
src/context.c
src/xkbcomp/alias.c
src/xkbcomp/keymap.c
src/xkbcomp/xkbcomp.c

index 3f2f13d..7112b47 100644 (file)
@@ -95,7 +95,7 @@ xkb_context_include_path_append(struct xkb_context *ctx, const char *path)
 _X_EXPORT int
 xkb_context_include_path_append_default(struct xkb_context *ctx)
 {
-    const char *home = getenv("HOME");
+    const char *home;
     char *user_path;
     int err;
 
index a6728db..2b05646 100644 (file)
@@ -214,9 +214,8 @@ ApplyAliases(struct xkb_keymap *keymap, AliasInfo ** info_in)
         *info_in = NULL;
         return true;
     }
+
     status = XkbcAllocNames(keymap, XkbKeyAliasesMask, nOld + nNew);
-    if (keymap->names)
-        old = keymap->names->key_aliases;
     if (status != Success)
     {
         WSGO("Allocation failure in ApplyAliases\n");
index a1f4c60..f3bf821 100644 (file)
@@ -68,7 +68,7 @@ CompileKeymap(struct xkb_context *ctx, XkbFile *file)
         return false;
     }
     have = 0;
-    ok = 1;
+
     /* Check for duplicate entries in the input file */
     for (file = (XkbFile *) file->defs; file; file = (XkbFile *) file->common.next)
     {
index 7e8763c..8518a1d 100644 (file)
@@ -199,7 +199,10 @@ compile_keymap(struct xkb_context *ctx, XkbFile *file)
 
     /* Find map to use */
     mapToUse = XkbChooseMap(file, NULL);
-    if (!mapToUse || mapToUse->type != XkmKeymapFile) {
+    if (!mapToUse)
+        goto err;
+
+    if (mapToUse->type != XkmKeymapFile) {
         ERROR("file type %d not handled\n", mapToUse->type);
         goto err;
     }