modesetting: clean up leaks
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
This commit is contained in:
parent
1754973206
commit
6b79a8791d
|
@ -530,15 +530,27 @@ static void msBlockHandler(BLOCKHANDLER_ARGS_DECL)
|
|||
static void
|
||||
FreeRec(ScrnInfoPtr pScrn)
|
||||
{
|
||||
modesettingPtr ms;
|
||||
|
||||
if (!pScrn)
|
||||
return;
|
||||
|
||||
if (!pScrn->driverPrivate)
|
||||
ms = modesettingPTR(pScrn);
|
||||
if (!ms)
|
||||
return;
|
||||
|
||||
free(pScrn->driverPrivate);
|
||||
|
||||
pScrn->driverPrivate = NULL;
|
||||
|
||||
if (ms->fd > 0) {
|
||||
int ret;
|
||||
|
||||
if (ms->pEnt->location.type == BUS_PCI)
|
||||
ret = drmClose(ms->fd);
|
||||
else
|
||||
ret = close(ms->fd);
|
||||
}
|
||||
free(ms->Options);
|
||||
free(ms);
|
||||
|
||||
}
|
||||
|
||||
static Bool
|
||||
|
|
Loading…
Reference in New Issue