diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-31 12:01:54 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-31 12:01:54 +0100 |
commit | a63ad78ed31e36dbdf3a9cd28071dcdbefce7d19 (patch) | |
tree | 7e7dcec72ffa2b5fd6236485dec104347f94aecf /src/gui_x11.c | |
parent | 9ba6194d4cba60fec4ed10c33d2d4fbe6e38c696 (diff) |
patch 9.0.0339: no check if the return value of XChangeGC() is NULLv9.0.0339
Problem: No check if the return value of XChangeGC() is NULL.
Solution: Only use the return value when it is not NULL. (closes #11020)
Diffstat (limited to 'src/gui_x11.c')
-rw-r--r-- | src/gui_x11.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gui_x11.c b/src/gui_x11.c index 6e3e903be4..7293ac4900 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -2231,10 +2231,14 @@ gui_x11_create_blank_mouse(void) { Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1); GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0); - XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0); - XFreeGC(gui.dpy, gc); + + if (gc != NULL) + { + XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0); + XFreeGC(gui.dpy, gc); + } return XCreatePixmapCursor(gui.dpy, blank_pixmap, blank_pixmap, - (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0); + (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0); } /* |