summaryrefslogtreecommitdiff
path: root/src/XListDProp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XListDProp.c')
-rw-r--r--src/XListDProp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/XListDProp.c b/src/XListDProp.c
index aee2737..66b9eca 100644
--- a/src/XListDProp.c
+++ b/src/XListDProp.c
@@ -49,33 +49,31 @@ XListDeviceProperties(Display* dpy, XDevice* dev, int *nprops_return)
Atom *props = NULL;
LockDisplay(dpy);
+ *nprops_return = 0;
if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1)
- return (NoSuchExtension);
+ goto cleanup;
GetReq(ListDeviceProperties, req);
req->reqType = info->codes->major_opcode;
req->ReqType = X_ListDeviceProperties;
req->deviceid = dev->device_id;
- if (!_XReply(dpy, (xReply*)&rep, 0, xFalse)) {
- *nprops_return = 0;
+ if (!_XReply(dpy, (xReply*)&rep, 0, xFalse))
goto cleanup;
- }
-
- *nprops_return = rep.nAtoms;
if (rep.nAtoms) {
props = (Atom*)Xmalloc(rep.nAtoms * sizeof(Atom));
if (!props)
{
_XEatData(dpy, rep.nAtoms << 2);
- *nprops_return = 0;
goto cleanup;
}
_XRead32(dpy, props, rep.nAtoms << 2);
}
+ *nprops_return = rep.nAtoms;
+
cleanup:
UnlockDisplay(dpy);
SyncHandle();