From 8627d0c659f5bb79ba29edd0e7264fb7549e6fac Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 16 Oct 2026 13:05:13 +0200 Subject: [PATCH] check return value of XCreateIC() --- dmenu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dmenu.c b/dmenu.c index c2425e2..2c64545 100644 --- a/dmenu.c +++ b/dmenu.c @@ -698,8 +698,9 @@ setup(void) if ((xim = XOpenIM(dpy, NULL, NULL, NULL)) == NULL) die("XOpenIM failed: could not open input device"); - xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, - XNClientWindow, win, XNFocusWindow, win, NULL); + if ((xic = XCreateIC(xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing, + XNClientWindow, win, XNFocusWindow, win, NULL)) == NULL) + die("XCreateIC failed: could not obtain input context"); XMapRaised(dpy, win); if (embed) {