[libgdata/libgdata-0-6] youtube: Fix a crash in the error handling code if no GError is passed in



commit dcc7f4b08d76c31298d6ee6225c4a278bc9996af
Author: Philip Withnall <philip tecnocode co uk>
Date:   Fri Dec 10 16:49:25 2010 +0000

    youtube: Fix a crash in the error handling code if no GError is passed in

 gdata/services/youtube/gdata-youtube-service.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdata/services/youtube/gdata-youtube-service.c b/gdata/services/youtube/gdata-youtube-service.c
index e763977..a9cc959 100644
--- a/gdata/services/youtube/gdata-youtube-service.c
+++ b/gdata/services/youtube/gdata-youtube-service.c
@@ -296,7 +296,7 @@ parse_error_response (GDataService *self, GDataOperationType operation_type, gui
 		}
 
 		/* Create an error message, but only for the first error */
-		if (*error == NULL) {
+		if (error == NULL || *error == NULL) {
 			/* See http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Error_responses */
 			if (xmlStrcmp (domain, (xmlChar*) "yt:service") == 0 && xmlStrcmp (code, (xmlChar*) "disabled_in_maintenance_mode") == 0) {
 				/* Service disabled */
@@ -344,7 +344,7 @@ parse_error_response (GDataService *self, GDataOperationType operation_type, gui
 
 check_error:
 	/* Ensure we're actually set an error message */
-	if (*error == NULL)
+	if (error != NULL && *error == NULL)
 		g_set_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR, _("Unknown and unparsable error received."));
 
 	return;



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