Fix property and selection devPrivate allocation.

Selection objects were not being allocated with privates, and both
objects had a stray statement that zeroed out the devPrivates field.

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Reported-by: Justin Mattock <justinmattock@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Eamon Walsh 2010-08-23 16:04:03 -04:00 committed by Keith Packard
parent 79ee78de9d
commit 9ef6241c23
2 changed files with 1 additions and 3 deletions

View File

@ -284,7 +284,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
pProp->format = format;
pProp->data = data;
pProp->size = len;
pProp->devPrivates = NULL;
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
DixCreateAccess|DixWriteAccess);
if (rc != Success) {

View File

@ -196,12 +196,11 @@ ProcSetSelectionOwner(ClientPtr client)
/*
* It doesn't exist, so add it...
*/
pSel = malloc(sizeof(Selection));
pSel = dixAllocateObjectWithPrivates(Selection, PRIVATE_SELECTION);
if (!pSel)
return BadAlloc;
pSel->selection = stuff->selection;
pSel->devPrivates = NULL;
/* security creation/labeling check */
rc = XaceHookSelectionAccess(client, &pSel,