aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/Xext/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/Xext/sync.c')
-rw-r--r--nx-X11/programs/Xserver/Xext/sync.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c
index 7fa6145a6..e90e35db9 100644
--- a/nx-X11/programs/Xserver/Xext/sync.c
+++ b/nx-X11/programs/Xserver/Xext/sync.c
@@ -296,14 +296,18 @@ static void
SyncDeleteTriggerFromCounter(pTrigger)
SyncTrigger *pTrigger;
{
- SyncTriggerList *pCur, *pPrev = NULL;
+ SyncTriggerList *pCur;
+ SyncTriggerList *pPrev;
/* pCounter needs to be stored in pTrigger before calling here. */
if (!pTrigger->pCounter)
return;
- for (pCur = pTrigger->pCounter->pTriglist; pCur; pCur = pCur->next)
+ pPrev = NULL;
+ pCur = pTrigger->pCounter->pTriglist;
+
+ while (pCur)
{
if (pCur->pTrigger == pTrigger)
{
@@ -311,9 +315,13 @@ SyncDeleteTriggerFromCounter(pTrigger)
pPrev->next = pCur->next;
else
pTrigger->pCounter->pTriglist = pCur->next;
+
free(pCur);
break;
}
+
+ pPrev = pCur;
+ pCur = pCur->next;
}
if (IsSystemCounter(pTrigger->pCounter))