[tracker/rss-enclosures] tracker-writeback: Fix cursor leak



commit f08b6d419a331f7bdcc1f26019116e47ae6722af
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]