mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
glx: Properly check for a valid fd in dri2CreateScreen().
Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
5a1ce49c82
commit
7d9e0ea739
1 changed files with 3 additions and 1 deletions
|
|
@ -804,6 +804,8 @@ dri2CreateScreen(int screen, struct glx_display * priv)
|
|||
return NULL;
|
||||
|
||||
memset(psc, 0, sizeof *psc);
|
||||
psc->fd = -1;
|
||||
|
||||
if (!glx_screen_init(&psc->base, screen, priv)) {
|
||||
Xfree(psc);
|
||||
return NULL;
|
||||
|
|
@ -921,7 +923,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
|
|||
return &psc->base;
|
||||
|
||||
handle_error:
|
||||
if (psc->fd)
|
||||
if (psc->fd >= 0)
|
||||
close(psc->fd);
|
||||
if (psc->driver)
|
||||
dlclose(psc->driver);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue