From 15773d23ec575cee0cf5396bc4183bc754785c8b Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 4 Nov 2008 16:47:34 +0000 Subject: [PATCH] (xim_close_dpy): Avoid double-free on X11R6 XIM. --- src/xterm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index 264f2c21363..788bc39e2d6 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8319,9 +8319,11 @@ xim_close_dpy (dpyinfo) XUnregisterIMInstantiateCallback (dpyinfo->display, dpyinfo->xrdb, NULL, EMACS_CLASS, xim_instantiate_callback, NULL); -#endif /* not HAVE_X11R6_XIM */ +#else /* not HAVE_X11R6_XIM */ + /* If we have X11R6 xim, this causes a double-free. */ if (dpyinfo->display) XCloseIM (dpyinfo->xim); +#endif /* HAVE_X11R6_XIM */ dpyinfo->xim = NULL; XFree (dpyinfo->xim_styles); } -- 2.39.2