summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2010-08-23 16:04:03 -0400
committerKeith Packard <keithp@keithp.com>2010-09-10 11:44:12 -0700
commit9ef6241c2382bfc555284a4985f6d1e37d750d6f (patch)
treede82944cfd03ea6f0a71f98b37adc776ed524dd5
parent79ee78de9de49d0cab03401662baa476a18e53b8 (diff)
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>
-rw-r--r--dix/property.c1
-rw-r--r--dix/selection.c3
2 files changed, 1 insertions, 3 deletions
diff --git a/dix/property.c b/dix/property.c
index 87e5c2d18..1d4332a58 100644
--- a/dix/property.c
+++ b/dix/property.c
@@ -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) {
diff --git a/dix/selection.c b/dix/selection.c
index bae3a3092..87ed1abe9 100644
--- a/dix/selection.c
+++ b/dix/selection.c
@@ -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,