aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-04-04 23:06:45 -0500
committerTed Gould <ted@gould.cx>2012-04-04 23:06:45 -0500
commit042406a84a19568ab4e417e51eac9a632970c25e (patch)
tree7e857baab9801a87d809f84126686645e78b665d
parent2d60549a2394ce7d73907abcaca22b48553d6c5b (diff)
downloadlibdbusmenu-042406a84a19568ab4e417e51eac9a632970c25e.tar.gz
libdbusmenu-042406a84a19568ab4e417e51eac9a632970c25e.tar.bz2
libdbusmenu-042406a84a19568ab4e417e51eac9a632970c25e.zip
Protect from the cases where we might get NULL in the data segment
-rw-r--r--libdbusmenu-glib/client.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 34f8b8d..78537f8 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1834,6 +1834,8 @@ struct _about_to_show_t {
static void
about_to_show_finish (about_to_show_t * data, gboolean need_update)
{
+ g_return_if_fail(data != NULL);
+
/* If we need to update, do that first. */
if (need_update) {
update_layout(data->client);
@@ -1938,6 +1940,8 @@ about_to_show_idle (gpointer user_data)
GQueue * showers = priv->about_to_show_to_go;
priv->about_to_show_to_go = NULL;
+ g_return_val_if_fail(showers != NULL, FALSE);
+
/* Figure out if we've got any callbacks */
gboolean got_callbacks = FALSE;
g_queue_foreach(showers, about_to_show_idle_callbacks, &got_callbacks);
@@ -1995,7 +1999,10 @@ about_to_show_cb (GObject * proxy, GAsyncResult * res, gpointer userdata)
g_variant_unref(params);
}
- about_to_show_finish(data, need_update);
+ if (data != NULL) {
+ about_to_show_finish(data, need_update);
+ }
+
return;
}