[brasero] Fix #600007 - Memory leaks in brasero



commit 401eae00cf9b88029f82475847c1bc113a483f4f
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Tue Nov 3 15:00:33 2009 +0100

    Fix #600007 -  Memory leaks in brasero
    Patch by Eric Sesterhenn <eric sesterhenn lsexperts de>
    This fixes unlikely memory leaks on error

 plugins/dvdcss/burn-dvdcss.c      |    4 ++--
 plugins/libburnia/burn-libisofs.c |   18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/plugins/dvdcss/burn-dvdcss.c b/plugins/dvdcss/burn-dvdcss.c
index 3467576..29018b1 100644
--- a/plugins/dvdcss/burn-dvdcss.c
+++ b/plugins/dvdcss/burn-dvdcss.c
@@ -256,12 +256,12 @@ brasero_dvdcss_create_scrambled_sectors_map (GQueue *map,
 				BraseroScrambledSectorRange *range;
 				GSList *extents;
 
-				range = g_new0 (BraseroScrambledSectorRange, 1);
-
 				/* take the first address for each extent of the file */
 				if (!file->specific.file.extents)
 					return FALSE;
 
+				range = g_new0 (BraseroScrambledSectorRange, 1);
+				
 				for (extents = file->specific.file.extents; extents; extents = extents->next) {
 					BraseroVolFileExtent *extent;
 
diff --git a/plugins/libburnia/burn-libisofs.c b/plugins/libburnia/burn-libisofs.c
index cf8cbc7..ef6f98a 100644
--- a/plugins/libburnia/burn-libisofs.c
+++ b/plugins/libburnia/burn-libisofs.c
@@ -460,15 +460,6 @@ brasero_libisofs_import_last_session (BraseroLibisofs *self,
 	if (!priv->ctx)
 		return BRASERO_BURN_ERR;
 
-	src = g_new0 (IsoDataSource, 1);
-	src->version = 0;
-	src->refcount = 1;
-	src->read_block = brasero_libisofs_import_read;
-	src->open = brasero_libisofs_import_open;
-	src->close = brasero_libisofs_import_close;
-	src->free_data = brasero_libisofs_import_free;
-	src->data = priv->ctx->drive;
-
 	result = iso_read_opts_new (&opts, 0);
 	if (result < 0) {
 		g_set_error (error,
@@ -478,6 +469,15 @@ brasero_libisofs_import_last_session (BraseroLibisofs *self,
 		return BRASERO_BURN_ERR;
 	}
 
+	src = g_new0 (IsoDataSource, 1);
+	src->version = 0;
+	src->refcount = 1;
+	src->read_block = brasero_libisofs_import_read;
+	src->open = brasero_libisofs_import_open;
+	src->close = brasero_libisofs_import_close;
+	src->free_data = brasero_libisofs_import_free;
+	src->data = priv->ctx->drive;
+
 	brasero_job_get_last_session_address (BRASERO_JOB (self), &session_block);
 	iso_read_opts_set_start_block (opts, session_block);
 



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