From 78eff73e4a8cf6a428dd4bd5ed50e0515ec8794f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 20 Jun 2019 00:51:32 +0200 Subject: render: Propagate allocation failure from createSourcePicture() commit 211d4c2d353b5e379716484055a3f58235ea65f4 Author: Chris Wilson Date: Wed Dec 14 15:55:22 2011 +0000 render: Propagate allocation failure from createSourcePicture() All the callers were already checking for failure, except that createSourcePicture() itself was failing to check whether it successfully allocated the Picture. [ajax: Rebase, fix line wrap of preceding line] Signed-off-by: Chris Wilson Reviewed-by: Jeremy Huddleston --- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 2 ++ nx-X11/programs/Xserver/render/picture.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index e35d1e9bc..01821f474 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -318,6 +318,8 @@ static PicturePtr createSourcePicture(void) sizeof(nxagentPrivPictureRec); pPicture = (PicturePtr) calloc(1, totalPictureSize); + if (!pPicture) + return 0; if (pPicture != NULL) { diff --git a/nx-X11/programs/Xserver/render/picture.c b/nx-X11/programs/Xserver/render/picture.c index eba042903..c06ac3550 100644 --- a/nx-X11/programs/Xserver/render/picture.c +++ b/nx-X11/programs/Xserver/render/picture.c @@ -979,6 +979,8 @@ static PicturePtr createSourcePicture(void) { PicturePtr pPicture; pPicture = (PicturePtr) malloc(sizeof(PictureRec)); + if (!pPicture) + return 0; pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; -- cgit v1.2.3