aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11/CrBFData.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/X11/CrBFData.c')
-rw-r--r--nx-X11/lib/X11/CrBFData.c7
1 files changed, 5 insertions, 2 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;