Coverity fix. CID:135 NULL_RETURNS
authorNelson Ferreira <nelson.ferreira@ieee.org>
Tue, 11 Oct 2011 00:36:35 +0000 (20:36 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Tue, 11 Oct 2011 00:36:35 +0000 (20:36 -0400)
* 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 <nelson.ferreira@ieee.org>
src/ui/X11/event-Xt.c

index 4d69694..5c5f9ba 100644 (file)
@@ -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 */