[brasero/gnome-2-28] Fix a potential crash when aborting the download of a Gstreamer plugin throught PackageKit



commit 1b7adc3cdf760b2766b1d02badd56e354f6c98f8
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Nov 4 15:25:59 2009 +0100

    Fix a potential crash when aborting the download of a Gstreamer plugin throught PackageKit

 libbrasero-utils/brasero-metadata.c |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/libbrasero-utils/brasero-metadata.c b/libbrasero-utils/brasero-metadata.c
index 92577bf..a52845d 100644
--- a/libbrasero-utils/brasero-metadata.c
+++ b/libbrasero-utils/brasero-metadata.c
@@ -892,9 +892,11 @@ brasero_metadata_install_plugins_success (BraseroMetadataGstDownload *download)
 
 		priv = BRASERO_METADATA_PRIVATE (iter->data);
 
-		/* free previously saved error message */
-		g_error_free (priv->error);
-		priv->error = NULL;
+		if (priv->error) {
+			/* free previously saved error message */
+			g_error_free (priv->error);
+			priv->error = NULL;
+		}
 
 		gst_element_set_state (GST_ELEMENT (priv->pipeline), GST_STATE_NULL);
 		gst_element_set_state (GST_ELEMENT (priv->pipeline), GST_STATE_PLAYING);
@@ -905,14 +907,20 @@ static void
 brasero_metadata_install_plugins_abort (BraseroMetadataGstDownload *download)
 {
 	GSList *iter;
+	GSList *next;
 
-	for (iter = download->objects; iter; iter = iter->next) {
+	for (iter = download->objects; iter; iter = next) {
 		BraseroMetadataPrivate *priv;
 
+		next = iter->next;
+
 		priv = BRASERO_METADATA_PRIVATE (iter->data);
 
-		g_error_free (priv->error);
-		priv->error = NULL;
+		if (priv->error) {
+			g_error_free (priv->error);
+			priv->error = NULL;
+		}
+
 		brasero_metadata_completed (BRASERO_METADATA (iter->data));
 	}
 }



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