[tracker/wip/carlosg/serialize-api: 11/36] libtracker-data: Plug leak




commit cb716cd75d7bf1aa9c80afe50b2e15f63f47192d
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 91807f165..1ae8168b6 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]