aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/record/record.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-23 07:03:58 +0000
committermarha <marha@users.sourceforge.net>2010-06-23 07:03:58 +0000
commit345335d61c71c245846d679d568a8b5eca1a5ca9 (patch)
tree7b878ae84134fa091dd2bdc2695251e609209ebe /xorg-server/record/record.c
parentfbbbbe88405440920f4baa5a3107ec0b9a6f8cb7 (diff)
parentc356d5298f18cd103ef7caad015d98d2022044ac (diff)
downloadvcxsrv-345335d61c71c245846d679d568a8b5eca1a5ca9.tar.gz
vcxsrv-345335d61c71c245846d679d568a8b5eca1a5ca9.tar.bz2
vcxsrv-345335d61c71c245846d679d568a8b5eca1a5ca9.zip
svn merge "^/branches/released" .
Diffstat (limited to 'xorg-server/record/record.c')
-rw-r--r--xorg-server/record/record.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/xorg-server/record/record.c b/xorg-server/record/record.c
index 53125079e..5e15c956a 100644
--- a/xorg-server/record/record.c
+++ b/xorg-server/record/record.c
@@ -997,10 +997,11 @@ RecordUninstallHooks(RecordClientsAndProtocolPtr pRCAP, XID oneclient)
ClientPtr pClient = clients[CLIENT_ID(client)];
int c;
Bool otherRCAPwantsProcVector = FALSE;
- RecordClientPrivatePtr pClientPriv =
- RecordClientPrivate(pClient);
+ RecordClientPrivatePtr pClientPriv = NULL;
- assert (pClient && RecordClientPrivate(pClient));
+ assert (pClient);
+ pClientPriv = RecordClientPrivate(pClient);
+ assert (pClientPriv);
memcpy(pClientPriv->recordVector, pClientPriv->originalVector,
sizeof (pClientPriv->recordVector));
@@ -2813,6 +2814,8 @@ RecordAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer callda
NewClientInfoRec *pci = (NewClientInfoRec *)calldata;
int i;
ClientPtr pClient = pci->client;
+ RecordContextPtr *ppAllContextsCopy = NULL;
+ int numContextsCopy = 0;
switch (pClient->clientState)
{
@@ -2834,10 +2837,17 @@ RecordAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer callda
case ClientStateGone:
case ClientStateRetained: /* client disconnected */
- for (i = 0; i < numContexts; i++)
+
+ /* RecordDisableContext modifies contents of ppAllContexts. */
+ numContextsCopy = numContexts;
+ ppAllContextsCopy = malloc(numContextsCopy * sizeof(RecordContextPtr));
+ assert(ppAllContextsCopy);
+ memcpy(ppAllContextsCopy, ppAllContexts, numContextsCopy * sizeof(RecordContextPtr));
+
+ for (i = 0; i < numContextsCopy; i++)
{
RecordClientsAndProtocolPtr pRCAP;
- RecordContextPtr pContext = ppAllContexts[i];
+ RecordContextPtr pContext = ppAllContextsCopy[i];
int pos;
if (pContext->pRecordingClient == pClient)
@@ -2851,6 +2861,8 @@ RecordAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer callda
RecordDeleteClientFromRCAP(pRCAP, pos);
}
}
+
+ free(ppAllContextsCopy);
break;
default: