diff options
author | Adam Jackson <ajax@redhat.com> | 2016-03-01 14:09:30 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-03-02 10:03:27 -0500 |
commit | 05e1bcf56e1c511a1ef539acfe11e37727e1179e (patch) | |
tree | ee26b65751863feffa141da8b6ac5bb455307126 | |
parent | 093f9505c12565cc19bdf6e33b263f31d104c3ef (diff) |
dri1: Fix unchecked AddResource
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | hw/xfree86/dri/dri.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 875c9cc6c..0046e52b0 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1032,7 +1032,8 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual, } /* track this in case the client dies before cleanup */ - AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv); + if (!AddResource(context, DRIContextPrivResType, (void *) pDRIContextPriv)) + return FALSE; return TRUE; } @@ -1263,8 +1264,9 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, } /* track this in case the client dies */ - AddResource(FakeClientID(client->index), DRIDrawablePrivResType, - (void *) (intptr_t) pDrawable->id); + if (!AddResource(FakeClientID(client->index), DRIDrawablePrivResType, + (void *) (intptr_t) pDrawable->id)) + return FALSE; if (pDRIDrawablePriv->hwDrawable) { drmUpdateDrawableInfo(pDRIPriv->drmFD, |