From 2bf89dbf20821870c55040187593aa6e07dda844 Mon Sep 17 00:00:00 2001 From: David Smith Date: Thu, 14 Aug 2008 01:21:27 +0900 Subject: [PATCH] Prevent double-free segfault when using XIM and multi-tty. When HAVE_X11R6_XIM is defined, let xim_destroy_callback, there is no need to call XCloseIM. --- src/xterm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index a32f4e1..ed982b8 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -8310,9 +8310,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 /* not HAVE_X11R6_XIM */ dpyinfo->xim = NULL; XFree (dpyinfo->xim_styles); } -- 1.5.4.3