[virt-tools-list] [PATCH virt-viewer 2/4] Do not try to unref NULL menu

Marc-André Lureau marcandre.lureau at gmail.com
Wed Mar 21 23:25:27 UTC 2012


From: Marc-Andre Lureau <marcandre.lureau at redhat.com>

---
 src/remote-viewer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 85ad319..d601ad3 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -320,7 +320,9 @@ spice_menu_update(RemoteViewer *self, VirtViewerWindow *win)
             ctrlmenu_to_gtkmenu(self, menu, G_OBJECT(self->priv->controller)));
         gtk_widget_set_visible(menuitem, TRUE);
     }
-    g_object_unref(menu);
+
+    if (menu != NULL)
+        g_object_unref(menu);
 }
 
 static void
-- 
1.7.7.6




More information about the virt-tools-list mailing list