aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-04-10 22:35:38 -0500
committerTed Gould <ted@gould.cx>2011-04-10 22:35:38 -0500
commitd3150ac5780e1e63f39746429a10dfe44f4c5099 (patch)
tree9f273e11e9fc4bf0424a4ff5d9d03c859de07386
parent45a154a22b63d3b07c2d2dd1304992c0a5b996f1 (diff)
downloadlibdbusmenu-d3150ac5780e1e63f39746429a10dfe44f4c5099.tar.gz
libdbusmenu-d3150ac5780e1e63f39746429a10dfe44f4c5099.tar.bz2
libdbusmenu-d3150ac5780e1e63f39746429a10dfe44f4c5099.zip
Protecting the label with the null check and don't unref something that shouldn't be.
-rw-r--r--libdbusmenu-gtk/client.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index aabdbc8..692bd03 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -887,11 +887,10 @@ new_item_normal (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusmenu
GtkMenuItem * gmi;
gmi = GTK_MENU_ITEM(g_object_new(GENERICMENUITEM_TYPE, NULL));
- gtk_menu_item_set_label(gmi, dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL));
if (gmi != NULL) {
+ gtk_menu_item_set_label(gmi, dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL));
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent);
- g_object_unref(gmi);
} else {
return FALSE;
}