From bee98f757e7e8d1f17160ac85c489e679e6ed908 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Mon, 11 Apr 2011 09:52:08 -0400 Subject: catch one more cancel-before-accessing freed memory instance -- this one resulting in a double free --- src/application-service-appstore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 3e827d5..4e32122 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -1110,6 +1110,11 @@ props_cb (GObject * object, GAsyncResult * res, gpointer user_data) GDBusProxy * proxy = g_dbus_proxy_new_for_bus_finish(res, &error); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + g_error_free (error); + return; // Must exit before accessing freed memory + } + if (app->props_cancel != NULL) { g_object_unref(app->props_cancel); app->props_cancel = NULL; -- cgit v1.2.3 From ce5dcdddf75b496c6b63f3a15f03cb788c4072f3 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Mon, 11 Apr 2011 14:18:15 -0400 Subject: make sure we can cancel GetAll call --- src/application-service-appstore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 3e827d5..0c1028f 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -576,6 +576,7 @@ static void get_all_properties (Application * app) { if (app->props != NULL && app->props_cancel == NULL) { + app->props_cancel = g_cancellable_new(); g_dbus_proxy_call(app->props, "GetAll", g_variant_new("(s)", NOTIFICATION_ITEM_DBUS_IFACE), G_DBUS_CALL_FLAGS_NONE, -1, app->props_cancel, -- cgit v1.2.3