[tracker/libtracker-client-error] libtracker-client: Fix memory corruption in error handling



commit b6239b0125403d40cb6d5185144169080a8a0185
Author: Jürg Billeter <j bitron ch>
Date:   Fri Jul 9 15:49:14 2010 +0200

    libtracker-client: Fix memory corruption in error handling
    
    Do not free error received in callback.

 src/libtracker-client/tracker.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index 2c84346..023c2c9 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -658,13 +658,13 @@ callback_iterator (void     *buffer,
 		tracker_result_iterator_free (iterator);
 	} else {
 		if (error->code != G_IO_ERROR_CANCELLED) {
-			g_clear_error (&error);
-			g_set_error (&error,
-			             TRACKER_CLIENT_ERROR,
-			             TRACKER_CLIENT_ERROR_BROKEN_PIPE,
-			             "Couldn't get results from server");
+			error = g_error_new (TRACKER_CLIENT_ERROR,
+			                     TRACKER_CLIENT_ERROR_BROKEN_PIPE,
+			                     "Couldn't get results from server");
 
 			(* fad->iterator_callback) (NULL, error, fad->user_data);
+
+			g_clear_error (&error);
 		}
 	}
 



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