aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/lib/X11/CrBFData.c7
-rw-r--r--nx-X11/lib/X11/CrPFBData.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/nx-X11/lib/X11/CrBFData.c b/nx-X11/lib/X11/CrBFData.c
index 449095690..95158755f 100644
--- a/nx-X11/lib/X11/CrBFData.c
+++ b/nx-X11/lib/X11/CrBFData.c
@@ -58,8 +58,11 @@ Pixmap XCreateBitmapFromData(
Pixmap pix;
pix = XCreatePixmap(display, d, width, height, 1);
- if (! (gc = XCreateGC(display, pix, (unsigned long) 0, (XGCValues *) 0)))
- return (Pixmap) None;
+ gc = XCreateGC(display, pix, (unsigned long) 0, (XGCValues *) 0);
+ if (gc == NULL) {
+ XFreePixmap(display, pix);
+ return (Pixmap) None;
+ }
ximage.height = height;
ximage.width = width;
ximage.depth = 1;
diff --git a/nx-X11/lib/X11/CrPFBData.c b/nx-X11/lib/X11/CrPFBData.c
index 57cd15303..d343420aa 100644
--- a/nx-X11/lib/X11/CrPFBData.c
+++ b/nx-X11/lib/X11/CrPFBData.c
@@ -66,8 +66,11 @@ Pixmap XCreatePixmapFromBitmapData(
pix = XCreatePixmap(display, d, width, height, depth);
gcv.foreground = fg;
gcv.background = bg;
- if (! (gc = XCreateGC(display, pix, GCForeground|GCBackground, &gcv)))
- return (Pixmap) NULL;
+ gc = XCreateGC(display, pix, GCForeground|GCBackground, &gcv);
+ if (gc == NULL) {
+ XFreePixmap(display, pix);
+ return (Pixmap) None;
+ }
ximage.height = height;
ximage.width = width;
ximage.depth = 1;