[tracker/wip/carlosg/benchmark: 1/2] libtracker-sparql: Port missing code to TrackerRowid
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/benchmark: 1/2] libtracker-sparql: Port missing code to TrackerRowid
- Date: Sun, 27 Feb 2022 15:31:47 +0000 (UTC)
commit f1f4050c1a4e67fe2b54f2afc817e8bffd8f1a0c
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Feb 27 16:16:44 2022 +0100
libtracker-sparql: Port missing code to TrackerRowid
This place was missing porting, which could cause crashes as we
are mixing memory from different allocators here.
src/libtracker-data/tracker-sparql.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-data/tracker-sparql.c b/src/libtracker-data/tracker-sparql.c
index d02686360..2397336e7 100644
--- a/src/libtracker-data/tracker-sparql.c
+++ b/src/libtracker-data/tracker-sparql.c
@@ -9513,7 +9513,7 @@ static gboolean
translate_BlankNode (TrackerSparql *sparql,
GError **error)
{
- gint64 bnode_id = 0;
+ TrackerRowid bnode_id = 0;
TrackerVariable *var;
/* BlankNode ::= BLANK_NODE_LABEL | ANON
@@ -9531,11 +9531,12 @@ translate_BlankNode (TrackerSparql *sparql,
tracker_token_bnode_init (sparql->current_state->token, bnode_id);
} else if (_accept (sparql, RULE_TYPE_TERMINAL, TERMINAL_TYPE_BLANK_NODE_LABEL)) {
gchar *str;
- gint64 *value;
str = _dup_last_string (sparql);
if (sparql->current_state->blank_node_map) {
+ TrackerRowid *value;
+
value = g_hash_table_lookup (sparql->current_state->blank_node_map, str);
if (value)
@@ -9548,10 +9549,9 @@ translate_BlankNode (TrackerSparql *sparql,
if (bnode_id == 0)
return FALSE;
- value = g_new0 (gint64, 1);
- *value = bnode_id;
g_hash_table_insert (sparql->current_state->blank_node_map,
- g_strdup (str), value);
+ g_strdup (str),
+ tracker_rowid_copy (&bnode_id));
}
if (sparql->blank_nodes &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]