From 5f55da01dbf96c7c81a5261e90db27bdf6a12374 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 19 Jul 2024 09:49:45 -0400 Subject: [PATCH] glx: tweak dri2 init ordering Reviewed-by: Adam Jackson Part-of: --- src/glx/dri2_glx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 4b69bbf047c..46ee6740e30 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1184,16 +1184,15 @@ dri2CreateDisplay(Display * dpy) if (!DRI2QueryExtension(dpy, &eventBase, &errorBase)) return NULL; + if (!DRI2QueryVersion(dpy, &driMajor, &driMinor) || + driMinor < 3) { + return NULL; + } pdp = malloc(sizeof *pdp); if (pdp == NULL) return NULL; - if (!DRI2QueryVersion(dpy, &driMajor, &driMinor) || - driMinor < 3) { - free(pdp); - return NULL; - } i = 0; pdp->loader_extensions[i++] = &dri2LoaderExtension.base;