[gnome-photos/gnome-3-20] utils: Don't leak the query string



commit bf8e1aaf85f996ceeb371531c6e6fbaf70f45705
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jul 8 09:36:40 2016 +0200

    utils: Don't leak the query string
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768548

 src/photos-utils.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 64827b7..0e5951a 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -1429,7 +1429,7 @@ photos_utils_set_favorite (const gchar *urn, gboolean is_favorite)
 {
   GError *error;
   PhotosTrackerQueue *queue = NULL;
-  gchar *sparql;
+  gchar *sparql = NULL;
 
   sparql = g_strdup_printf ("%s { <%s> nao:hasTag nao:predefined-tag-favorite }",
                             (is_favorite) ? "INSERT OR REPLACE" : "DELETE",
@@ -1447,5 +1447,6 @@ photos_utils_set_favorite (const gchar *urn, gboolean is_favorite)
   photos_tracker_queue_update (queue, sparql, NULL, photos_utils_update_executed, g_strdup (urn), g_free);
 
  out:
+  g_free (sparql);
   g_clear_object (&queue);
 }


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