[tracker/wip/carlosg/more-bus-fixes: 4/4] libtracker-sparql/bus: Check return value of function
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/more-bus-fixes: 4/4] libtracker-sparql/bus: Check return value of function
- Date: Sat, 23 Jul 2022 18:20:42 +0000 (UTC)
commit 806431aa1b1e00e5a5e450e259d3643b3bade635
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Jul 23 19:43:55 2022 +0200
libtracker-sparql/bus: Check return value of function
Leftover from the prior fixes when reading cursor data.
Fixes: 39d54f1c3 (libtracker-sparql/bus: Check errors and return...)
src/libtracker-sparql/bus/tracker-bus-cursor.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-sparql/bus/tracker-bus-cursor.c b/src/libtracker-sparql/bus/tracker-bus-cursor.c
index a260c28eb..491b27117 100644
--- a/src/libtracker-sparql/bus/tracker-bus-cursor.c
+++ b/src/libtracker-sparql/bus/tracker-bus-cursor.c
@@ -274,10 +274,14 @@ tracker_bus_cursor_next (TrackerSparqlCursor *cursor,
g_clear_pointer (&bus_cursor->row_data, g_free);
bus_cursor->row_data =
g_new0 (gchar, offsets[n_columns - 1] + 1);
- g_input_stream_read_all (G_INPUT_STREAM (bus_cursor->data_stream),
- bus_cursor->row_data,
- offsets[n_columns - 1] + 1,
- NULL, NULL, NULL);
+
+ if (!g_input_stream_read_all (G_INPUT_STREAM (bus_cursor->data_stream),
+ bus_cursor->row_data,
+ offsets[n_columns - 1] + 1,
+ NULL, NULL, error)) {
+ g_free (offsets);
+ return FALSE;
+ }
g_clear_pointer (&bus_cursor->values, g_free);
bus_cursor->values = g_new0 (const gchar *, n_columns);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]