miext/sync/misyncfd.c: Don't leak the screen private

Signed-off-by: stefan11111 <stefan11111github@gmail.com>
This commit is contained in:
stefan11111 2026-08-22 17:00:34 +03:00 • committed by Enrico Weigelt
commit 852128f184

View file

@ -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;
}