[gnome-photos/gnome-3-26] local-item: Don't leak the source path and URI



commit 0e30afdc8056056dfbf02dcf8acf10e2d9447a3c
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Sep 22 13:13:55 2017 +0200

    local-item: Don't leak the source path and URI

 src/photos-local-item.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-local-item.c b/src/photos-local-item.c
index 20b0572..532ed86 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -182,8 +182,8 @@ photos_local_item_get_source_widget (PhotosBaseItem *item)
       GFile *source_link;
       GtkWidget *label;
       const gchar *uri;
-      gchar *source_path;
-      gchar *source_uri;
+      gchar *source_path = NULL;
+      gchar *source_uri = NULL;
 
       uri = photos_base_item_get_uri (item);
       file = g_file_new_for_uri (uri);
@@ -198,6 +198,8 @@ photos_local_item_get_source_widget (PhotosBaseItem *item)
       gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
       gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
 
+      g_free (source_path);
+      g_free (source_uri);
       g_object_unref (source_link);
       g_object_unref (file);
     }


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