[gnome-online-accounts/gnome-3-14] Fix a life-cycle issue in the oauth2 provider



commit 646555e7b351fc18f377e89548dc9231c6bee389
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 10 14:21:31 2014 -0400

    Fix a life-cycle issue in the oauth2 provider
    
    When calling g_propagate_error on an error, the src becomes invalid,
    but you have to clear your pointer yourself, if you want to keep
    using it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737549

 src/goabackend/goaoauth2provider.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index c81949c..a2cd347 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -1259,7 +1259,10 @@ goa_oauth2_provider_add_account (GoaProvider *_provider,
    * eg., if we failed to store the credentials in the keyring.
    */
   if (priv->error != NULL)
-    g_propagate_error (error, priv->error);
+    {
+      g_propagate_error (error, priv->error);
+      priv->error = NULL;
+    }
   else
     g_assert (ret != NULL);
 
@@ -1352,7 +1355,10 @@ goa_oauth2_provider_refresh_account (GoaProvider  *_provider,
 
  out:
   if (priv->error != NULL)
-    g_propagate_error (error, priv->error);
+    {
+      g_propagate_error (error, priv->error);
+      priv->error = NULL;
+    }
 
   gtk_widget_destroy (dialog);
   return ret;


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