dix: CreateScratchGC: avoid dereference of pointer we just set to NULL

Clears warning from gcc 14.1:

../dix/gc.c: In function ‘CreateScratchGC’:
../dix/gc.c:818:28: warning: dereference of NULL ‘pGC’
 [CWE-476] [-Wanalyzer-null-dereference]
  818 |     pGC->graphicsExposures = FALSE;

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1673>
This commit is contained in:
Alan Coopersmith 2024-09-08 10:03:08 -07:00 committed by Enrico Weigelt, metux IT consult
parent 80284fae7e
commit c85765ea53

View File

@ -813,7 +813,8 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
FreeGC(pGC, (XID) 0); FreeGC(pGC, (XID) 0);
pGC = (GCPtr) NULL; pGC = (GCPtr) NULL;
} }
pGC->graphicsExposures = FALSE; else
pGC->graphicsExposures = FALSE;
return pGC; return pGC;
} }