[tracker/rss-enclosures] libtracker-data: Avoid reading already disposed memory



commit 3cb7d77af2a88c2b3a5b754d70a1ae2d9b1f2f9e
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Wed Jul 21 16:47:49 2010 +0200

    libtracker-data: Avoid reading already disposed memory

 src/libtracker-data/tracker-data-backup.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index 96fad9b..a4e8dc2 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -205,7 +205,7 @@ process_context_child_watch_cb (GPid     pid,
 	context = (ProcessContext *) user_data;
 
 	if (context->lines) {
-		g_set_error (&error, TRACKER_DATA_BACKUP_ERROR, 0, 
+		g_set_error (&error, TRACKER_DATA_BACKUP_ERROR, 0,
 		             "%s", context->lines->str);
 	}
 
@@ -282,7 +282,7 @@ tracker_data_backup_save (GFile *destination,
 	                                        &stdout_channel,
 	                                        &stderr_channel)) {
 		GError *error = NULL;
-		g_set_error (&error, TRACKER_DATA_BACKUP_ERROR, 0, 
+		g_set_error (&error, TRACKER_DATA_BACKUP_ERROR, 0,
 		             "Error starting tar program");
 		on_journal_copied (info, error);
 		g_strfreev (argv);
@@ -307,11 +307,10 @@ tracker_data_backup_save (GFile *destination,
 
 	g_child_watch_add (context->pid, process_context_child_watch_cb, context);
 
-	g_strfreev (argv);
-
 	g_debug ("Process '%d' spawned for command:'%s %s %s'",
 	         pid, argv[0], argv[1], argv[2]);
 
+	g_strfreev (argv);
 }
 
 static gboolean
@@ -370,19 +369,19 @@ tracker_data_backup_restore (GFile *journal,
 		 * journal, as nobody should be writing anything at this point */
 
 		if (!tracker_spawn (argv, 0, &tmp_stdout, &tmp_stderr, &exit_status)) {
-			g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0, 
+			g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0,
 			             "Error starting tar program");
 		}
 
 		if (!info->error && tmp_stderr) {
 			if (strlen (tmp_stderr) > 0) {
-				g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0, 
+				g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0,
 				             "%s", tmp_stderr);
 			}
 		}
 
 		if (!info->error && exit_status != 0) {
-			g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0, 
+			g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0,
 			             "Unknown error, tar exited with exit status %d", exit_status);
 		}
 
@@ -406,7 +405,7 @@ tracker_data_backup_restore (GFile *journal,
 		                           "Restoring backup");
 
 	} else {
-		g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0, 
+		g_set_error (&info->error, TRACKER_DATA_BACKUP_ERROR, 0,
 		             "Backup file doesn't exist");
 	}
 



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