[gnome-online-accounts/gnome-3-20] identity: Don't leak operation_result when handling ExchangeSecretKeys



commit 389ce7fad248998178778ca4a95dd8d09d4f38eb
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 5 15:23:58 2017 +0100

    identity: Don't leak operation_result when handling ExchangeSecretKeys
    
    The lifecycle of operation_result is controlled by the g_bus_watch_name
    call and the watched_client_connections hash table. Therefore, we
    should not unref it when there is an error in on_caller_watched. What
    we should do is drop our reference to it right after starting to watch
    the bus.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776897

 src/goaidentity/goaidentityservice.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/goaidentity/goaidentityservice.c b/src/goaidentity/goaidentityservice.c
index 503265a..551737a 100644
--- a/src/goaidentity/goaidentityservice.c
+++ b/src/goaidentity/goaidentityservice.c
@@ -584,7 +584,6 @@ on_caller_watched (GDBusConnection    *connection,
                                        GCR_ERROR_UNRECOGNIZED,
                                        _("Initial secret key is invalid"));
       g_simple_async_result_complete_in_idle (operation_result);
-      g_object_unref (operation_result);
       return;
     }
 
@@ -665,6 +664,7 @@ goa_identity_service_handle_exchange_secret_keys (GoaIdentityServiceManager *man
                        g_strdup (sender),
                        GUINT_TO_POINTER (watch_id));
 
+  g_object_unref (operation_result);
   return TRUE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]