mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-15 05:23:40 +00:00
miext/sync/misyncfd.c: Don't leak the screen private
Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
parent
e9fe96ed50
commit
852128f184
1 changed files with 3 additions and 6 deletions
|
|
@ -79,13 +79,12 @@ Bool miSyncFdScreenInit(ScreenPtr pScreen,
|
|||
return FALSE;
|
||||
|
||||
if (!dixPrivateKeyRegistered(&syncFdScreenPrivateKey)) {
|
||||
if (!dixRegisterPrivateKey(&syncFdScreenPrivateKey, PRIVATE_SCREEN, 0))
|
||||
if (!dixRegisterPrivateKey(&syncFdScreenPrivateKey, PRIVATE_SCREEN, sizeof(SyncFdScreenPrivateRec)))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
priv = calloc(1, sizeof (SyncFdScreenPrivateRec));
|
||||
if (!priv)
|
||||
return FALSE;
|
||||
priv = sync_fd_screen_priv(pScreen);
|
||||
memset(priv, 0, sizeof(*priv));
|
||||
|
||||
/* Will require version checks when there are multiple versions
|
||||
* of the funcs structure
|
||||
|
|
@ -93,7 +92,5 @@ Bool miSyncFdScreenInit(ScreenPtr pScreen,
|
|||
|
||||
priv->funcs = *funcs;
|
||||
|
||||
dixSetPrivate(&pScreen->devPrivates, &syncFdScreenPrivateKey, priv);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue