[tracker/class-signal: 46/61] tracker-writeback: Fix cursor leak



commit 689e60848ba6ea9bdeb779da5790b680403e7755
Author: Jürg Billeter <j bitron ch>
Date:   Fri Aug 27 12:56:09 2010 +0200

    tracker-writeback: Fix cursor leak

 src/tracker-writeback/tracker-writeback-consumer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-consumer.c b/src/tracker-writeback/tracker-writeback-consumer.c
index cd71348..4d3f923 100644
--- a/src/tracker-writeback/tracker-writeback-consumer.c
+++ b/src/tracker-writeback/tracker-writeback-consumer.c
@@ -287,8 +287,10 @@ rdf_types_to_uris_cb (GObject      *object,
 
 		if (cursor && tracker_sparql_cursor_next (cursor, NULL, NULL)) {
 			subject = tracker_sparql_cursor_get_string (cursor, 0, NULL);
-			if (!subject)
+			if (!subject) {
+				g_object_unref (cursor);
 				goto trouble;
+			}
 		} else {
 			if (cursor)
 				g_object_unref (cursor);
@@ -309,6 +311,7 @@ rdf_types_to_uris_cb (GObject      *object,
 		                                       consumer);
 
 		g_free (query);
+		g_object_unref (cursor);
 
 	} else {
 		goto trouble;



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