summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-02-17 13:19:42 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-02-21 11:19:14 +1000
commite1686fdbb8729f9f639ecab6860690103bb25db1 (patch)
tree6fab4d3b2e051c13c954fe039f069cca029f74bc
parentf427c74b6cd7089690c000c257468629a762b1eb (diff)
Always call XCloseDisplay()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r--src/xinput.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/xinput.c b/src/xinput.c
index a336f53..a1bb221 100644
--- a/src/xinput.c
+++ b/src/xinput.c
@@ -368,17 +368,17 @@ main(int argc, char * argv[])
if (display == NULL) {
fprintf(stderr, "Unable to connect to X server\n");
- return EXIT_FAILURE;
+ goto out;
}
if (!XQueryExtension(display, "XInputExtension", &xi_opcode, &event, &error)) {
printf("X Input extension not available.\n");
- return EXIT_FAILURE;
+ goto out;
}
if (!xinput_version(display)) {
fprintf(stderr, "%s extension not available\n", INAME);
- return EXIT_FAILURE;
+ goto out;
}
while(driver->func_name) {
@@ -394,6 +394,9 @@ main(int argc, char * argv[])
usage();
+out:
+ if (display)
+ XCloseDisplay(display);
return EXIT_FAILURE;
}