Skip to content

Commit

Permalink
fm-properties-window: Fix memory leaks
Browse files Browse the repository at this point in the history
'g_strconcat' needs to be freed
  • Loading branch information
sc0w authored and lukefromdc committed Dec 1, 2018
1 parent 09eda67 commit a8de3bb
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/file-manager/fm-properties-window.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3039,6 +3039,7 @@ create_pie_widget (FMPropertiesWindow *window)
gchar *free; gchar *free;
const char *fs_type; const char *fs_type;
gchar *uri; gchar *uri;
gchar *concat;
GFile *location; GFile *location;
GFileInfo *info; GFileInfo *info;


Expand Down Expand Up @@ -3093,7 +3094,9 @@ create_pie_widget (FMPropertiesWindow *window)


gtk_widget_set_size_request (used_canvas, 20, 20); gtk_widget_set_size_request (used_canvas, 20, 20);
/* Translators: "used" refers to the capacity of the filesystem */ /* 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 (); free_canvas = gtk_drawing_area_new ();


Expand All @@ -3102,9 +3105,13 @@ create_pie_widget (FMPropertiesWindow *window)


gtk_widget_set_size_request (free_canvas, 20, 20); gtk_widget_set_size_request (free_canvas, 20, 20);
/* Translators: "free" refers to the capacity of the filesystem */ /* 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); fstype_label = gtk_label_new (NULL);


location = g_file_new_for_uri (uri); location = g_file_new_for_uri (uri);
Expand All @@ -3113,9 +3120,9 @@ create_pie_widget (FMPropertiesWindow *window)
if (info) { if (info) {
fs_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE); fs_type = g_file_info_get_attribute_string (info, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
if (fs_type != NULL) { if (fs_type != NULL) {
gchar *fstype_text = g_strconcat (_("Filesystem type:"), " ", fs_type, NULL); concat = g_strconcat (_("Filesystem type:"), " ", fs_type, NULL);
gtk_label_set_text (GTK_LABEL (fstype_label), fstype_text); gtk_label_set_text (GTK_LABEL (fstype_label), concat);
g_free (fstype_text); g_free (concat);
} }


g_object_unref (info); g_object_unref (info);
Expand Down

0 comments on commit a8de3bb

Please sign in to comment.