From 084decde9945791e7116a16876aabb1788049616 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 27 Aug 2009 08:34:46 -0500 Subject: Check the return of g_new0 for NULL. Comment by Neil. --- libdbusmenu-glib/client.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 9004f55..92c7aa9 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -622,11 +622,15 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it /* Get the properties queued up for this item */ /* Not happy about this, but I need these :( */ newItemPropData * propdata = g_new0(newItemPropData, 1); - propdata->client = client; - propdata->item = item; - propdata->parent = parent; - - org_freedesktop_dbusmenu_get_properties_async(proxy, id, menuitem_get_properties_new_cb, propdata); + if (propdata != NULL) { + propdata->client = client; + propdata->item = item; + propdata->parent = parent; + + org_freedesktop_dbusmenu_get_properties_async(proxy, id, menuitem_get_properties_new_cb, propdata); + } else { + g_warning("Unable to allocate memory to get properties for menuitem. This menuitem will never be realized."); + } } xmlNodePtr children; -- cgit v1.2.3