[gnome-online-accounts] kerberos: Only write to the optional (out) variable if it is not NULL



commit 9224f0254535869bb5aa1acd0cfb29669c0aac2c
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 16 17:20:32 2016 +0100

    kerberos: Only write to the optional (out) variable if it is not NULL
    
    This isn't a problem at the moment, but every other implementation of
    this virtual method does the same, so let's be consistent.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762155

 src/goabackend/goakerberosprovider.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/goabackend/goakerberosprovider.c b/src/goabackend/goakerberosprovider.c
index 8e018af..d11815a 100644
--- a/src/goabackend/goakerberosprovider.c
+++ b/src/goabackend/goakerberosprovider.c
@@ -1425,7 +1425,9 @@ ensure_credentials_sync (GoaProvider    *provider,
   if (time_span < 0 || time_span > G_MAXINT)
     time_span = 0;
 
-  *out_expires_in = (int) time_span;
+  if (out_expires_in != NULL)
+    *out_expires_in = (int) time_span;
+
   credentials_ensured = TRUE;
 
   g_date_time_unref (now);


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