aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/record
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-23 06:38:04 +0000
committermarha <marha@users.sourceforge.net>2010-06-23 06:38:04 +0000
commitc356d5298f18cd103ef7caad015d98d2022044ac (patch)
tree6eb4fe5cf11588223e1d1da94d5ed41ca5e6f96c /xorg-server/record
parent5bb359288aac7b23042dc168608f2ced46c851da (diff)
downloadvcxsrv-c356d5298f18cd103ef7caad015d98d2022044ac.tar.gz
vcxsrv-c356d5298f18cd103ef7caad015d98d2022044ac.tar.bz2
vcxsrv-c356d5298f18cd103ef7caad015d98d2022044ac.zip
xserver git update 23/6/2010
Diffstat (limited to 'xorg-server/record')
-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: