summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-09-07 18:06:57 +0200
committerCarlos Garnacho <carlosg@gnome.org>2020-09-14 12:14:28 +0200
commit2a6c761756950eca47948c5005f4ff6665ed83e4 (patch)
tree52ef96753b3874e5bf235ba1c15520aa6f01fbda
parent574b2ce8cff250e5fa832c7dab2458f33503fc80 (diff)
downloadtracker-2a6c761756950eca47948c5005f4ff6665ed83e4.tar.gz
libtracker-data: Ensure there is an error on all failure paths
The services virtual table filter() function implementation was missing a GError in some failure paths. Spotted by Coverity. CID: #1491444
-rw-r--r--src/libtracker-data/tracker-vtab-service.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libtracker-data/tracker-vtab-service.c b/src/libtracker-data/tracker-vtab-service.c
index eac11d8b6..a14d50509 100644
--- a/src/libtracker-data/tracker-vtab-service.c
+++ b/src/libtracker-data/tracker-vtab-service.c
@@ -337,8 +337,21 @@ service_filter (sqlite3_vtab_cursor *vtab_cursor,
}
}
- if (!cursor->service || !cursor->query)
+ if (!cursor->service) {
+ g_set_error (&error,
+ TRACKER_SPARQL_ERROR,
+ TRACKER_SPARQL_ERROR_PARSE,
+ "Service not given to services virtual table");
goto fail;
+ }
+
+ if (!cursor->query) {
+ g_set_error (&error,
+ TRACKER_SPARQL_ERROR,
+ TRACKER_SPARQL_ERROR_PARSE,
+ "Query not given to services virtual table");
+ goto fail;
+ }
connection = g_hash_table_lookup (cursor->vtab->cached_connections,
cursor->service);