Skip to content

Commit

Permalink
patch 9.0.0339: no check if the return value of XChangeGC() is NULL
Browse files Browse the repository at this point in the history
Problem:    No check if the return value of XChangeGC() is NULL.
Solution:   Only use the return value when it is not NULL. (closes #11020)
  • Loading branch information
brammool committed Aug 31, 2022
1 parent 9ba6194 commit a63ad78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/gui_x11.c
Expand Up @@ -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);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -707,6 +707,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
339,
/**/
338,
/**/
Expand Down

0 comments on commit a63ad78

Please sign in to comment.