dix: NULL-protect FreeGC()

Make it possible to call FreeGC() w/o prior NULL checks.
In case of NULL, BadMatch is returned.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-03-13 13:13:47 +01:00
parent 9266733da3
commit 1eaf1b0191

View File

@ -768,6 +768,8 @@ int
FreeGC(void *value, XID gid)
{
GCPtr pGC = (GCPtr) value;
if (!pGC)
return BadMatch;
CloseFont(pGC->font, (Font) 0);
if (pGC->funcs)