summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-12-01 17:01:05 +0100
committerlukefromdc <[email protected]>2018-12-03 17:38:23 -0500
commit157d047cf3fced73a44f1fd0662ff1151c67bcfb (patch)
tree7e9cd5d1c72f726c4b75d0d3a64ebe32c3901eca
parentbd0d9985b266d4fa383213a0e61925cbc1c87b7b (diff)
downloadcaja-157d047cf3fced73a44f1fd0662ff1151c67bcfb.tar.bz2
caja-157d047cf3fced73a44f1fd0662ff1151c67bcfb.tar.xz
fm-properties-window: Fix memory leaks
'g_strconcat' needs to be freed
-rw-r--r--src/file-manager/fm-properties-window.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c
index 12fc57fa..8e92adae 100644
--- a/src/file-manager/fm-properties-window.c
+++ b/src/file-manager/fm-properties-window.c
@@ -3039,6 +3039,7 @@ create_pie_widget (FMPropertiesWindow *window)
gchar *free;
const char *fs_type;
gchar *uri;
+ gchar *concat;
GFile *location;
GFileInfo *info;
@@ -3093,7 +3094,9 @@ create_pie_widget (FMPropertiesWindow *window)
gtk_widget_set_size_request (used_canvas, 20, 20);
/* Translators: "used" refers to the capacity of the filesystem */
- used_label = gtk_label_new (g_strconcat (used, " ", _("used"), NULL));
+ concat = g_strconcat (used, " ", _("used"), NULL);
+ used_label = gtk_label_new (concat);
+ g_free (concat);
free_canvas = gtk_drawing_area_new ();
@@ -3102,9 +3105,13 @@ create_pie_widget (FMPropertiesWindow *window)
gtk_widget_set_size_request (free_canvas, 20, 20);
/* Translators: "free" refers to the capacity of the filesystem */
- free_label = gtk_label_new (g_strconcat (free, " ", _("free"), NULL));
+ concat = g_strconcat (free, " ", _("free"), NULL);
+ free_label = gtk_label_new (concat);
+ g_free (concat);
- capacity_label = gtk_label_new (g_strconcat (_("Total capacity:"), " ", capacity, NULL));
+ concat = g_strconcat (_("Total capacity:"), " ", capacity, NULL);
+ capacity_label = gtk_label_new (concat);
+ g_free (concat);
fstype_label = gtk_label_new (NULL);
location = g_file_new_for_uri (uri);
@@ -3113,9 +3120,9 @@ create_pie_widget (FMPropertiesWindow *window)
if (info) {
fs_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
if (fs_type != NULL) {
- gchar *fstype_text = g_strconcat (_("Filesystem type:"), " ", fs_type, NULL);
- gtk_label_set_text (GTK_LABEL (fstype_label), fstype_text);
- g_free (fstype_text);
+ concat = g_strconcat (_("Filesystem type:"), " ", fs_type, NULL);
+ gtk_label_set_text (GTK_LABEL (fstype_label), concat);
+ g_free (concat);
}
g_object_unref (info);