From c40c70c6cee475ab2bf8d7e6e5804571b25deb9c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 18 Nov 2010 14:41:27 -0600 Subject: Protect against NULL params (which they should be) but not leak just in case --- libdbusmenu-glib/client.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 0479548..cb3377a 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1206,10 +1206,12 @@ menuitem_call_cb (GObject * proxy, GAsyncResult * res, gpointer userdata) g_object_unref(edata->menuitem); g_free(edata); - if (error != NULL) { + if (G_UNLIKELY(error != NULL)) { g_error_free(error); } - g_variant_unref(params); + if (G_LIKELY(params != NULL)) { + g_variant_unref(params); + } return; } -- cgit v1.2.3