From 9ef6241c2382bfc555284a4985f6d1e37d750d6f Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Mon, 23 Aug 2010 16:04:03 -0400 Subject: [PATCH] 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 Reported-by: Justin Mattock Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- dix/property.c | 1 - dix/selection.c | 3 +-- 2 files changed, 1 insertion(+), 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,