[tracker-miners/wip/carlosg/invalid-reads] libtracker-miner: Add missing ref to SPARQL buffer task
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/wip/carlosg/invalid-reads] libtracker-miner: Add missing ref to SPARQL buffer task
- Date: Sun, 11 Oct 2020 12:42:08 +0000 (UTC)
commit d5ba6f69a02b710a470109cb466698baee3b0ce8
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Oct 11 14:23:21 2020 +0200
libtracker-miner: Add missing ref to SPARQL buffer task
On error paths, we let tracker_sparql_buffer_push_finish() still return
the underlying TrackerTask, together with the error, so we can detach
it properly.
However, in this situation we are not adding an extra task ref, while
the callback expects to own a reference. This causes refcounting issues
and eventually invalid reads.
Fixes: https://gitlab.gnome.org/GNOME/tracker-miners/-/issues/130
src/libtracker-miner/tracker-sparql-buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-miner/tracker-sparql-buffer.c b/src/libtracker-miner/tracker-sparql-buffer.c
index d5a538d41..7afa12dde 100644
--- a/src/libtracker-miner/tracker-sparql-buffer.c
+++ b/src/libtracker-miner/tracker-sparql-buffer.c
@@ -522,7 +522,7 @@ tracker_sparql_buffer_push_finish (TrackerSparqlBuffer *buffer,
task = g_task_propagate_pointer (G_TASK (res), error);
if (!task)
- task = g_task_get_task_data (G_TASK (res));
+ task = g_object_ref (g_task_get_task_data (G_TASK (res)));
return task;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]