aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-05-20 11:49:08 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-06-03 08:23:26 +0200
commit41cc5239f3fdb992f9dc76e22161179fdb50026c (patch)
treec106999dd31e9432ff8ecae73601e3400fd402fc /ui
parentdaafc661cc1a1de5a2e8ea0a7c0f396b827ebc3b (diff)
downloadqemu-41cc5239f3fdb992f9dc76e22161179fdb50026c.zip
qemu-41cc5239f3fdb992f9dc76e22161179fdb50026c.tar.gz
qemu-41cc5239f3fdb992f9dc76e22161179fdb50026c.tar.bz2
gtk: fix unchecked vc dereference
Spotted by Coverity. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1463737748-1062-1-git-send-email-kraxel@redhat.com
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 7572cec..01b8216 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1477,13 +1477,14 @@ static void gd_grab_pointer(VirtualConsole *vc, const char *reason)
static void gd_ungrab_pointer(GtkDisplayState *s)
{
VirtualConsole *vc = s->ptr_owner;
- GdkDisplay *display = gtk_widget_get_display(vc->gfx.drawing_area);
+ GdkDisplay *display;
if (vc == NULL) {
return;
}
s->ptr_owner = NULL;
+ display = gtk_widget_get_display(vc->gfx.drawing_area);
#if GTK_CHECK_VERSION(3, 20, 0)
gd_grab_update(vc, vc->s->kbd_owner == vc, false);
gdk_device_warp(gd_get_pointer(display),