[tracker/wip/carlosg/more-bus-fixes: 1/4] libtracker-sparql/bus: Plug potential leak on error paths
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/wip/carlosg/more-bus-fixes: 1/4] libtracker-sparql/bus: Plug potential leak on error paths
- Date: Sat, 23 Jul 2022 18:42:46 +0000 (UTC)
commit 39ccedbfc506f6decf7e058017ec3d03679efdff
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Jul 21 12:30:24 2022 +0200
libtracker-sparql/bus: Plug potential leak on error paths
src/libtracker-sparql/bus/tracker-bus-cursor.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-sparql/bus/tracker-bus-cursor.c b/src/libtracker-sparql/bus/tracker-bus-cursor.c
index 66de6c875..0e50a17ac 100644
--- a/src/libtracker-sparql/bus/tracker-bus-cursor.c
+++ b/src/libtracker-sparql/bus/tracker-bus-cursor.c
@@ -250,10 +250,12 @@ tracker_bus_cursor_next (TrackerSparqlCursor *cursor,
offsets = g_new0 (gint32, n_columns);
if (!g_input_stream_read_all (G_INPUT_STREAM (bus_cursor->data_stream),
- offsets,
- n_columns * sizeof (gint32),
- NULL, NULL, error))
+ offsets,
+ n_columns * sizeof (gint32),
+ NULL, NULL, error)) {
+ g_free (offsets);
return FALSE;
+ }
if (!validate_offsets (offsets, n_columns, error)) {
g_free (offsets);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]