[tracker/wip/carlosg/serialize-api: 1/26] libtracker-data: Plug leak




commit 757ef93404a5623b64fa55e649675b615e943ea8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Dec 19 11:31:45 2021 +0100

    libtracker-data: Plug leak
    
    The object_str string was being leaked. Actually, we don't need a
    copy of it.

 src/libtracker-data/tracker-data-update.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index d0b68edce..6f504143e 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -2511,11 +2511,11 @@ tracker_data_insert_statement_with_uri (TrackerData      *data,
                return;
 
        if (predicate == tracker_ontologies_get_rdf_type (ontologies)) {
-               gchar *object_str = NULL;
+               const gchar *object_str = NULL;
                gint64 object_id;
 
                object_id = g_value_get_int64 (object);
-               object_str = g_strdup (tracker_ontologies_get_uri_by_id (ontologies, object_id));
+               object_str = tracker_ontologies_get_uri_by_id (ontologies, object_id);
 
                /* handle rdf:type statements specially to
                   cope with inference and insert blank rows */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]