[tracker] examples: Check tracker_sparql_cursor_next() return value.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] examples: Check tracker_sparql_cursor_next() return value.
- Date: Mon, 30 Jan 2017 11:12:48 +0000 (UTC)
commit 05f8152a1fe7e8bf20859ba69f35d86ba4674996
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jan 30 12:09:39 2017 +0100
examples: Check tracker_sparql_cursor_next() return value.
Coverity ID: 1188420
examples/libtracker-sparql/class-signal.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/examples/libtracker-sparql/class-signal.c b/examples/libtracker-sparql/class-signal.c
index 63fce7b..5fda328 100644
--- a/examples/libtracker-sparql/class-signal.c
+++ b/examples/libtracker-sparql/class-signal.c
@@ -34,10 +34,9 @@ handle_statement (gint subject, gint predicate)
cursor = tracker_sparql_connection_query (con, query, NULL, NULL);
g_free (query);
- if (!cursor)
+ if (!cursor || !tracker_sparql_cursor_next (cursor, NULL, NULL))
return;
- tracker_sparql_cursor_next (cursor, NULL, NULL);
pred = g_strdup (tracker_sparql_cursor_get_string (cursor, 1, NULL));
query = g_strdup_printf ("SELECT ?t { <%s> <%s> ?t }",
tracker_sparql_cursor_get_string (cursor, 0, NULL),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]