From 1436690a43b5d4eebc879661c9ca9f879876affa Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 6 May 2025 14:38:22 +0200 Subject: [PATCH] glx: fix warning on potentially uninitialized variable in xorgGlxMakeCurrent() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit | ../glx/glxcmds.c: In function ‘xorgGlxMakeCurrent’: | ../glx/glxcmds.c:621:24: warning: use of uninitialized value ‘status’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value] | 621 | return status; | | ^~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult --- glx/glxcmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 54d6d7924..4123bcd4b 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -609,8 +609,6 @@ xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId, /* Look up new context. It must not be current for someone else. */ if (contextId != None) { - int status; - if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error)) return error; @@ -618,12 +616,14 @@ xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId, return BadAccess; if (drawId) { + int status = 0; drawPriv = __glXGetDrawable(glxc, drawId, client, &status); if (drawPriv == NULL) return status; } if (readId) { + int status = 0; readPriv = __glXGetDrawable(glxc, readId, client, &status); if (readPriv == NULL) return status;