xfixes: XFixesSelectCursorInput() use calloc()
In general safer coding practise to always use calloc() instead of risking forgetting to zero-out some fields. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
911d22b8e0
commit
87f3335cff
|
|
@ -229,11 +229,10 @@ XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask)
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
if (!e) {
|
if (!e) {
|
||||||
e = (CursorEventPtr) malloc(sizeof(CursorEventRec));
|
e = (CursorEventPtr) calloc(1, sizeof(CursorEventRec));
|
||||||
if (!e)
|
if (!e)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
e->next = 0;
|
|
||||||
e->pClient = pClient;
|
e->pClient = pClient;
|
||||||
e->pWindow = pWindow;
|
e->pWindow = pWindow;
|
||||||
e->clientResource = FakeClientID(pClient->index);
|
e->clientResource = FakeClientID(pClient->index);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue