aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-06-20 00:51:32 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-06-22 11:30:47 +0200
commit78eff73e4a8cf6a428dd4bd5ed50e0515ec8794f (patch)
tree1d53f6036741d85c56b52b9fd67617daf9ac6668
parent9f9b790f855f4a969b4ae6730e9cad8a9e743a3a (diff)
downloadnx-libs-78eff73e4a8cf6a428dd4bd5ed50e0515ec8794f.tar.gz
nx-libs-78eff73e4a8cf6a428dd4bd5ed50e0515ec8794f.tar.bz2
nx-libs-78eff73e4a8cf6a428dd4bd5ed50e0515ec8794f.zip
render: Propagate allocation failure from createSourcePicture()
commit 211d4c2d353b5e379716484055a3f58235ea65f4 Author: Chris Wilson <chris@chris-wilson.co.uk> 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 <chris@chris-wilson.co.uk> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXpicture.c2
-rw-r--r--nx-X11/programs/Xserver/render/picture.c2
2 files changed, 4 insertions, 0 deletions
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;