[tracker] libtracker-client: Fix double free in error handling
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-client: Fix double free in error handling
- Date: Fri, 9 Jul 2010 14:24:35 +0000 (UTC)
commit a6f48242e6abeb369fd6d909edcfa821ac71a4df
Author: Jürg Billeter <j bitron ch>
Date: Fri Jul 9 15:49:14 2010 +0200
libtracker-client: Fix double free in error handling
Do not free error received in callback.
src/libtracker-client/tracker.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-client/tracker.c b/src/libtracker-client/tracker.c
index 2c84346..ac28c6d 100644
--- a/src/libtracker-client/tracker.c
+++ b/src/libtracker-client/tracker.c
@@ -658,13 +658,15 @@ 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");
+ GError *iterator_error;
- (* fad->iterator_callback) (NULL, error, fad->user_data);
+ iterator_error = g_error_new (TRACKER_CLIENT_ERROR,
+ TRACKER_CLIENT_ERROR_BROKEN_PIPE,
+ "Couldn't get results from server");
+
+ (* fad->iterator_callback) (NULL, iterator_error, fad->user_data);
+
+ g_error_free (iterator_error);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]