From ac97fb2b804809c39b12fe0032d96fb076657258 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Mon, 7 Mar 2016 23:20:27 +0100 Subject: [PATCH] dri3: return an error if AddResource fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: RĂ©mi Cardona Signed-off-by: Julien Cristau --- dri3/dri3_request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c index 2b3622148..35548b6d2 100644 --- a/dri3/dri3_request.c +++ b/dri3/dri3_request.c @@ -178,8 +178,8 @@ proc_dri3_pixmap_from_buffer(ClientPtr client) (*drawable->pScreen->DestroyPixmap) (pixmap); return rc; } - if (AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) - return Success; + if (!AddResource(stuff->pixmap, RT_PIXMAP, (void *) pixmap)) + return BadAlloc; return Success; }