From: Nelson Ferreira Date: Tue, 11 Oct 2011 00:36:35 +0000 (-0400) Subject: Coverity fix. CID:135 NULL_RETURNS X-Git-Tag: v22.1.15~92^2~3 X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=0ab9fcceed4677e7d1c856ce7b85702a6a9a43f4;p=sxemacs Coverity fix. CID:135 NULL_RETURNS * src/ui/X11/event-Xt.c (x_to_emacs_keysym): make fure there is a frame before dereferencing to get the XIC. Signed-off-by: Nelson Ferreira --- diff --git a/src/ui/X11/event-Xt.c b/src/ui/X11/event-Xt.c index 4d69694..5c5f9ba 100644 --- a/src/ui/X11/event-Xt.c +++ b/src/ui/X11/event-Xt.c @@ -1149,9 +1149,11 @@ x_to_emacs_keysym(XKeyPressedEvent * event, int simple_p) int bufsiz = sizeof(buffer); Status status; #ifdef XIM_XLIB - XIC xic = FRAME_X_XIC(x_any_window_to_frame - (get_device_from_display(event->display), - event->window)); + XIC xic = NULL; + struct frame * f = + x_any_window_to_frame(get_device_from_display(event->display)); + if (f) + xic = FRAME_X_XIC(f, event->window)); #endif /* XIM_XLIB */ #endif /* HAVE_XIM */