From c85765ea532756370e487f122107ca029d9b70b1 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 8 Sep 2024 10:03:08 -0700 Subject: [PATCH] dix: CreateScratchGC: avoid dereference of pointer we just set to NULL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: --- dix/gc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dix/gc.c b/dix/gc.c index 3ae65f68b..8ee94d2e5 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -813,7 +813,8 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) FreeGC(pGC, (XID) 0); pGC = (GCPtr) NULL; } - pGC->graphicsExposures = FALSE; + else + pGC->graphicsExposures = FALSE; return pGC; }