From 60dccd9a7be95e35b4b8c90934888efedfde84cc Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sun, 19 Nov 2006 01:04:26 -0800 Subject: Bug #8663: _XiCheckExtInit must drop the Display lock in all error cases. --- src/XExtInt.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/XExtInt.c b/src/XExtInt.c index 427e406..8366104 100644 --- a/src/XExtInt.c +++ b/src/XExtInt.c @@ -80,9 +80,6 @@ typedef struct _XInputData XExtensionVersion *vers; } XInputData; -#define XInputCheckExtension(dpy,i,val) \ - XextCheckExtension (dpy, i, xinput_extension_name, val) - static /* const */ XExtensionHooks xinput_extension_hooks = { NULL, /* create_gc */ NULL, /* copy_gc */ @@ -183,6 +180,12 @@ _xidevicebusy(dpy, error) *error = info->codes->first_error + XI_DeviceBusy; } +static int XInputCheckExtension(Display *dpy, XExtDisplayInfo *info) +{ + XextCheckExtension (dpy, info, xinput_extension_name, 0); + return 1; +} + /*********************************************************************** * * Check to see if the input extension is installed in the server. @@ -198,7 +201,10 @@ _XiCheckExtInit(dpy, version_index, info) { XExtensionVersion *ext; - XInputCheckExtension(dpy, info, -1); + if (!XInputCheckExtension(dpy, info)) { + UnlockDisplay(dpy); + return (-1); + } if (info->data == NULL) { info->data = (XPointer) Xmalloc(sizeof(XInputData)); -- cgit v1.2.3