[tracker] libtracker-sparql: Plug leak



commit 7d0d34b787000bccf77e1b6605e2a12689ba8fd0
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Sep 9 12:12:45 2018 +0200

    libtracker-sparql: Plug leak

 src/libtracker-sparql/tracker-resource.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-resource.c b/src/libtracker-sparql/tracker-resource.c
index 982699e6a..e7d46df36 100644
--- a/src/libtracker-sparql/tracker-resource.c
+++ b/src/libtracker-sparql/tracker-resource.c
@@ -1001,14 +1001,17 @@ is_builtin_class (const gchar             *uri_or_curie,
                   TrackerNamespaceManager *namespaces)
 {
        gchar *prefix = NULL;
+       gboolean has_prefix;
 
        prefix = g_uri_parse_scheme (uri_or_curie);
 
-       if (prefix &&
-           tracker_namespace_manager_has_prefix (namespaces, prefix))
+       if (!prefix)
                return TRUE;
 
-       return FALSE;
+       has_prefix = tracker_namespace_manager_has_prefix (namespaces, prefix);
+       g_free (prefix);
+
+       return has_prefix;
 }
 
 static void


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