diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/spice-display.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/ui/spice-display.c b/ui/spice-display.c index 0360abfd2c..77c8cbab88 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -737,9 +737,7 @@ static void display_mouse_set(DisplayChangeListener *dcl, qemu_mutex_lock(&ssd->lock); ssd->ptr_x = x; ssd->ptr_y = y; - if (ssd->ptr_move) { - g_free(ssd->ptr_move); - } + g_free(ssd->ptr_move); ssd->ptr_move = qemu_spice_create_cursor_update(ssd, NULL, on); qemu_mutex_unlock(&ssd->lock); } @@ -752,13 +750,9 @@ static void display_mouse_define(DisplayChangeListener *dcl, qemu_mutex_lock(&ssd->lock); ssd->hot_x = c->hot_x; ssd->hot_y = c->hot_y; - if (ssd->ptr_move) { - g_free(ssd->ptr_move); - ssd->ptr_move = NULL; - } - if (ssd->ptr_define) { - g_free(ssd->ptr_define); - } + g_free(ssd->ptr_move); + ssd->ptr_move = NULL; + g_free(ssd->ptr_define); ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c, 0); qemu_mutex_unlock(&ssd->lock); } |