diff options
author | nobled <nobled@dreamwidth.org> | 2010-08-19 14:06:21 -0400 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2011-02-28 15:16:56 -0800 |
commit | d7d55ab8418c79c51207149d8982cd5e0990427c (patch) | |
tree | 1eb4de34b7e8bb9726ebbea3ba08673975df4545 /src | |
parent | bba05bc69907537cdc141322d9ffcc3007238650 (diff) |
glx: Put null check before use
'dpy' was being checked for null *after* it was already used once.
Also add a null check for psc, and drop gc's redundant initialization.
(cherry picked from commit b5dc40710d0e5edffb9f673dfbf26df4d0043eef)
Diffstat (limited to 'src')
-rw-r--r-- | src/glx/glxcmds.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 4f7e84ef5f..d9ca3f51af 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -214,12 +214,16 @@ CreateContext(Display * dpy, int generic_id, Bool allowDirect, unsigned code, int renderType, int screen) { - struct glx_context *gc = NULL; - struct glx_screen *const psc = GetGLXScreenConfigs(dpy, screen); + struct glx_context *gc; + struct glx_screen *psc; struct glx_context *shareList = (struct glx_context *) shareList_user; if (dpy == NULL) return NULL; + psc = GetGLXScreenConfigs(dpy, screen); + if (psc == NULL) + return NULL; + if (generic_id == None) return NULL; |