Xext: Recover from miSyncInitFenceFromFD failure without crashing

miSyncDestroyFence must not be called unless miSyncInitFence has been
invoked, so if miSyncInitFenceFromFD fails, we must free the fence
manually.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fredrik Höglund <fredrik@kde.org>
This commit is contained in:
Keith Packard 2013-11-18 22:33:27 -08:00
parent e7000534a4
commit 037566c57c

View File

@ -929,7 +929,7 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered); status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
if (status != Success) { if (status != Success) {
miSyncDestroyFence(pFence); dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
return status; return status;
} }