glx: fix warning on potentially uninitialized variable in xorgGlxMakeCurrent()

| ../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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-06 14:38:22 +02:00
parent 2274f23e60
commit 1436690a43

View File

@ -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;