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:
parent
79ee78de9d
commit
9ef6241c23
|
@ -284,7 +284,6 @@ dixChangeWindowProperty(ClientPtr pClient, WindowPtr pWin, Atom property,
|
||||||
pProp->format = format;
|
pProp->format = format;
|
||||||
pProp->data = data;
|
pProp->data = data;
|
||||||
pProp->size = len;
|
pProp->size = len;
|
||||||
pProp->devPrivates = NULL;
|
|
||||||
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
|
rc = XaceHookPropertyAccess(pClient, pWin, &pProp,
|
||||||
DixCreateAccess|DixWriteAccess);
|
DixCreateAccess|DixWriteAccess);
|
||||||
if (rc != Success) {
|
if (rc != Success) {
|
||||||
|
|
|
@ -196,12 +196,11 @@ ProcSetSelectionOwner(ClientPtr client)
|
||||||
/*
|
/*
|
||||||
* It doesn't exist, so add it...
|
* It doesn't exist, so add it...
|
||||||
*/
|
*/
|
||||||
pSel = malloc(sizeof(Selection));
|
pSel = dixAllocateObjectWithPrivates(Selection, PRIVATE_SELECTION);
|
||||||
if (!pSel)
|
if (!pSel)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
pSel->selection = stuff->selection;
|
pSel->selection = stuff->selection;
|
||||||
pSel->devPrivates = NULL;
|
|
||||||
|
|
||||||
/* security creation/labeling check */
|
/* security creation/labeling check */
|
||||||
rc = XaceHookSelectionAccess(client, &pSel,
|
rc = XaceHookSelectionAccess(client, &pSel,
|
||||||
|
|
Loading…
Reference in New Issue