[Mesa-dev] [PATCH 1/3] glx: Fix leaks in DRI2 screen creation error paths.
Julien Cristau
jcristau at debian.org
Mon Jan 31 08:43:06 PST 2011
On Sun, Jan 30, 2011 at 00:00:48 +0100, Henri Verbeet wrote:
> @@ -918,12 +921,15 @@ dri2CreateScreen(int screen, struct glx_display * priv)
> return &psc->base;
>
> handle_error:
> + if (psc->fd)
> + close(psc->fd);
0 is a valid fd. It might be better to initialize fd to -1 and check
for >= 0 here.
> + if (psc->driver)
> + dlclose(psc->driver);
> Xfree(driverName);
> Xfree(deviceName);
> + glx_screen_cleanup(&psc->base);
> XFree(psc);
>
> - /* FIXME: clean up here */
> -
> return NULL;
> }
>
Cheers,
Julien
More information about the mesa-dev
mailing list