summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2016-03-01 14:09:29 -0500
committerAdam Jackson <ajax@redhat.com>2016-03-02 10:03:11 -0500
commit093f9505c12565cc19bdf6e33b263f31d104c3ef (patch)
tree8fbafbffcaf0dd5b40473d574440d0d619368407 /Xext
parentac4d8c7cee13947b688ebb26035f06f7744db201 (diff)
xv: Fix unchecked AddResource
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/xvmain.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 0c6f25b5a..3a0263427 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -844,7 +844,8 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
tpn->client = NULL;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTVideoNotify, tpn);
+ if (!AddResource(tpn->id, XvRTVideoNotify, tpn))
+ return BadAlloc;
tpn->client = client;
return Success;
@@ -893,7 +894,8 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
tpn->client = client;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTPortNotify, tpn);
+ if (!AddResource(tpn->id, XvRTPortNotify, tpn))
+ return BadAlloc;
return Success;