summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2022-10-24 15:15:03 +0200
committerCarlos Garnacho <carlosg@gnome.org>2022-10-24 15:30:14 +0200
commitd5a52c12009c26491845774dee7bfbfd41d9ffaa (patch)
tree0fdc00a9a02da428d7434a7d64e2052427a882d5
parent73f48e423db3cda43bbc615030ce974822b42ca1 (diff)
downloadtracker-d5a52c12009c26491845774dee7bfbfd41d9ffaa.tar.gz
libtracker-sparql/core: Plug leak in triples vtab
The TrackerTriplesVTab struct created to back the tracker_triples table up is not being properly freed. Since this is an eponymous-only table, we never drop the table, thus the xDisconnect vfunc is the right one for us. In case we ever wanted to drop the table, make the xDestroy method the same, since this virtual table creates no supporting non-virtual tables.
-rw-r--r--src/libtracker-sparql/core/tracker-vtab-triples.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libtracker-sparql/core/tracker-vtab-triples.c b/src/libtracker-sparql/core/tracker-vtab-triples.c
index 6879da38b..d8077a80f 100644
--- a/src/libtracker-sparql/core/tracker-vtab-triples.c
+++ b/src/libtracker-sparql/core/tracker-vtab-triples.c
@@ -253,12 +253,6 @@ triples_best_index (sqlite3_vtab *vtab,
static int
triples_disconnect (sqlite3_vtab *vtab)
{
- return SQLITE_OK;
-}
-
-static int
-triples_destroy (sqlite3_vtab *vtab)
-{
tracker_triples_vtab_free (vtab);
return SQLITE_OK;
}
@@ -640,7 +634,7 @@ tracker_vtab_triples_init (sqlite3 *db,
triples_connect,
triples_best_index,
triples_disconnect,
- triples_destroy,
+ triples_disconnect, /* destroy(), can be the same since no real tables are created */
triples_open,
triples_close,
triples_filter,