[X2Go-Commits] [nx-libs] 94/219: render: Propagate allocation failure from createSourcePicture()

git-admin at x2go.org git-admin at x2go.org
Sat Sep 28 12:10:29 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 78eff73e4a8cf6a428dd4bd5ed50e0515ec8794f
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Thu Jun 20 00:51:32 2019 +0200

    render: Propagate allocation failure from createSourcePicture()
    
      commit 211d4c2d353b5e379716484055a3f58235ea65f4
      Author: Chris Wilson <chris at 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 at chris-wilson.co.uk>
        Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
---
 nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 2 ++
 nx-X11/programs/Xserver/render/picture.c       | 2 ++
 2 files changed, 4 insertions(+)

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;

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list