[libgdata] core: Fix a NULL pointer ref. inc. in GDataService



commit db6ee229558fcd749fc2e6ea2b2fb26bfa46d082
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Aug 20 17:38:20 2011 +0100

    core: Fix a NULL pointer ref. inc. in GDataService

 gdata/gdata-service.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index 0a9c47f..a082668 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -285,9 +285,12 @@ real_append_query_headers (GDataService *self, GDataAuthorizationDomain *domain,
 	if (self->priv->authorizer != NULL) {
 		gdata_authorizer_process_request (self->priv->authorizer, domain, message);
 
-		/* Store the authorisation domain on the message so that we can access it again after refreshing authorisation if necessary.
-		 * See _gdata_service_send_message(). */
-		g_object_set_data_full (G_OBJECT (message), "gdata-authorization-domain", g_object_ref (domain), (GDestroyNotify) g_object_unref);
+		if (domain != NULL) {
+			/* Store the authorisation domain on the message so that we can access it again after refreshing authorisation if necessary.
+			 * See _gdata_service_send_message(). */
+			g_object_set_data_full (G_OBJECT (message), "gdata-authorization-domain", g_object_ref (domain),
+			                        (GDestroyNotify) g_object_unref);
+		}
 	}
 
 	/* Set the GData-Version header to tell it we want to use the v2 API */



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