From 87f3335cff670bc6f9e2a32afb84360c43054d22 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Fri, 21 Feb 2025 12:13:24 +0100 Subject: [PATCH] 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 --- xfixes/cursor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 0a24bfd13..4585bdcdf 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -229,11 +229,10 @@ XFixesSelectCursorInput(ClientPtr pClient, WindowPtr pWindow, CARD32 eventMask) return Success; } if (!e) { - e = (CursorEventPtr) malloc(sizeof(CursorEventRec)); + e = (CursorEventPtr) calloc(1, sizeof(CursorEventRec)); if (!e) return BadAlloc; - e->next = 0; e->pClient = pClient; e->pWindow = pWindow; e->clientResource = FakeClientID(pClient->index);