summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2018-01-09 11:48:10 -0500
committerTimo Aaltonen <tjaalton@debian.org>2018-02-13 10:39:53 +0200
commite69c7fd6840e7e18061c7dfee1197e60e919bddb (patch)
tree2bc737ff7275971239ca2f9b197e4db612623195 /render
parentecd9d73f2af51885c5aa17e73d747663a2689a49 (diff)
animcur: Handle allocation failure for the animation timerfor-1.19
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Tested-by: Aaron Plattner <aplattner@nvidia.com> (cherry picked from commit 4d82a150b2ee29c1025408cdb9ece255452a81bd)
Diffstat (limited to 'render')
-rw-r--r--render/animcur.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/render/animcur.c b/render/animcur.c
index e585a8f23..5ed929e73 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -302,7 +302,7 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
CursorPtr *ppCursor, ClientPtr client, XID cid)
{
CursorPtr pCursor;
- int rc, i;
+ int rc = BadAlloc, i;
AnimCurPtr ac;
for (i = 0; i < screenInfo.numScreens; i++)
@@ -317,7 +317,7 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
sizeof(AnimCurRec) +
ncursor * sizeof(AnimCurElt), 1);
if (!pCursor)
- return BadAlloc;
+ return rc;
dixInitPrivates(pCursor, pCursor + 1, PRIVATE_CURSOR);
pCursor->bits = &animCursorBits;
pCursor->refcnt = 1;
@@ -336,8 +336,10 @@ AnimCursorCreate(CursorPtr *cursors, CARD32 *deltas, int ncursor,
ac->timer = TimerSet(NULL, 0, 0, AnimCurTimerNotify, NULL);
/* security creation/labeling check */
- rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
- RT_NONE, NULL, DixCreateAccess);
+ if (ac->timer)
+ rc = XaceHook(XACE_RESOURCE_ACCESS, client, cid, RT_CURSOR, pCursor,
+ RT_NONE, NULL, DixCreateAccess);
+
if (rc != Success) {
TimerFree(ac->timer);
dixFiniPrivates(pCursor, PRIVATE_CURSOR);