comparison src/gui_x11.c @ 30003:01087b4630da v9.0.0339

patch 9.0.0339: no check if the return value of XChangeGC() is NULL Commit: https://github.com/vim/vim/commit/a63ad78ed31e36dbdf3a9cd28071dcdbefce7d19 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Aug 31 12:01:54 2022 +0100 patch 9.0.0339: no check if the return value of XChangeGC() is NULL Problem: No check if the return value of XChangeGC() is NULL. Solution: Only use the return value when it is not NULL. (closes https://github.com/vim/vim/issues/11020)
author Bram Moolenaar <Bram@vim.org>
date Wed, 31 Aug 2022 13:15:02 +0200
parents 9849df834f1d
children 029c59bf78f1
comparison
equal deleted inserted replaced
30002:b3fd1aacd62a 30003:01087b4630da
2229 static Cursor 2229 static Cursor
2230 gui_x11_create_blank_mouse(void) 2230 gui_x11_create_blank_mouse(void)
2231 { 2231 {
2232 Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1); 2232 Pixmap blank_pixmap = XCreatePixmap(gui.dpy, gui.wid, 1, 1, 1);
2233 GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0); 2233 GC gc = XCreateGC(gui.dpy, blank_pixmap, (unsigned long)0, (XGCValues*)0);
2234 XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0); 2234
2235 XFreeGC(gui.dpy, gc); 2235 if (gc != NULL)
2236 {
2237 XDrawPoint(gui.dpy, blank_pixmap, gc, 0, 0);
2238 XFreeGC(gui.dpy, gc);
2239 }
2236 return XCreatePixmapCursor(gui.dpy, blank_pixmap, blank_pixmap, 2240 return XCreatePixmapCursor(gui.dpy, blank_pixmap, blank_pixmap,
2237 (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0); 2241 (XColor*)&gui.norm_pixel, (XColor*)&gui.norm_pixel, 0, 0);
2238 } 2242 }
2239 2243
2240 /* 2244 /*
2241 * Draw a curled line at the bottom of the character cell. 2245 * Draw a curled line at the bottom of the character cell.
2242 */ 2246 */