summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@openbsd.org>2009-12-06 10:32:31 +0000
committerMatthieu Herrb <matthieu@openbsd.org>2009-12-06 10:32:31 +0000
commite1b340d67cc1a26464bbc683fcef696857651fe8 (patch)
treeac5dd501d4675376c4b420f4aebb06dd2b579388
parent2c2f38946df4c0cd0c7813507af57128a422bf74 (diff)
Remove the input driver before returning NULL on error in PreInit().
-rw-r--r--src/ws.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ws.c b/src/ws.c
index 15461bc..7a889ab 100644
--- a/src/ws.c
+++ b/src/ws.c
@@ -336,10 +336,13 @@ wsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
pInfo->flags |= XI86_CONFIGURED;
return pInfo;
fail:
- if (priv != NULL)
+ if (priv != NULL) {
xfree(priv);
- if (pInfo != NULL)
- xfree(pInfo);
+ pInfo->private = NULL;
+ }
+ if (pInfo != NULL) {
+ xf86DeleteInput(pInfo, 0);
+ }
return NULL;
}