[tracker] libtracker-sparql: Plug TrackerResource leaks



commit d3395e5cff445157dd0271c69af1472cde4e65d8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Nov 27 19:52:45 2016 +0100

    libtracker-sparql: Plug TrackerResource leaks
    
    The context is reused, so the list must be freed again after the
    second use.

 src/libtracker-sparql/tracker-resource.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-resource.c b/src/libtracker-sparql/tracker-resource.c
index 78e7d8e..e76852e 100644
--- a/src/libtracker-sparql/tracker-resource.c
+++ b/src/libtracker-sparql/tracker-resource.c
@@ -1036,6 +1036,8 @@ generate_turtle_uri_value (const char              *uri_or_curie_or_blank,
                        /* It's a full URI (or something invalid, but we can't really tell that here) */
                        g_string_append_printf (string, "<%s>", uri_or_curie_or_blank);
                }
+
+               g_free (prefix);
        }
 }
 
@@ -1463,5 +1465,8 @@ tracker_resource_print_sparql_update (TrackerResource         *resource,
        }
        g_string_append (context.string, "}\n");
 
+       g_list_free (context.done_list);
+       context.done_list = NULL;
+
        return g_string_free (context.string, FALSE);
 }


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