Tests: Release context on failure to build keymap
authorDaniel Stone <daniel@fooishbar.org>
Thu, 29 Mar 2012 16:38:44 +0000 (17:38 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 29 Mar 2012 16:38:44 +0000 (17:38 +0100)
No practical effect since they exit(1) regardless, but it keeps valgrind
happy.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
test/filecomp.c
test/namescomp.c
test/rulescomp.c

index 3ba1b57..26bfaa6 100644 (file)
@@ -85,6 +85,7 @@ int main(int argc, char *argv[])
 
     if (!xkb) {
         fprintf(stderr, "Failed to compile keymap\n");
+        xkb_context_unref(context);
         exit(1);
     }
 
index 4e8bf5c..d16d375 100644 (file)
@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
 
     if (!xkb) {
         fprintf(stderr, "Failed to compile keymap\n");
+        xkb_context_unref(context);
         exit(1);
     }
 
index a25b0a9..da9f619 100644 (file)
@@ -58,6 +58,7 @@ int main(int argc, char *argv[])
 
     if (!xkb) {
         fprintf(stderr, "Failed to compile keymap\n");
+        xkb_context_unref(context);
         exit(1);
     }