From f13479d193c89eb5a497e06ad16657ee6850f896 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 21 Oct 2021 17:30:27 +0200 Subject: appearance: fix memory leak --- capplets/appearance/mate-wp-item.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/capplets/appearance/mate-wp-item.c b/capplets/appearance/mate-wp-item.c index 766f1b7a..1b0566ff 100644 --- a/capplets/appearance/mate-wp-item.c +++ b/capplets/appearance/mate-wp-item.c @@ -190,6 +190,7 @@ void mate_wp_item_free (MateWPItem * item) { g_free (item->name); g_free (item->filename); g_free (item->description); + g_free (item->artist); if (item->pcolor != NULL) gdk_rgba_free (item->pcolor); @@ -276,7 +277,7 @@ void mate_wp_item_update_description (MateWPItem * item) { if (!strcmp (item->filename, "(none)")) { item->description = g_strdup (item->name); } else { - const gchar *description; + gchar *description; gchar *size; gchar *dirname = g_path_get_dirname (item->filename); gchar *artist; @@ -292,9 +293,9 @@ void mate_wp_item_update_description (MateWPItem * item) { if (strcmp (item->fileinfo->mime_type, "application/xml") == 0) { if (mate_bg_changes_with_time (item->bg)) - description = _("Slide Show"); + description = g_strdup (_("Slide Show")); else if (item->width > 0 && item->height > 0) - description = _("Image"); + description = g_strdup (_("Image")); } else description = g_content_type_get_description (item->fileinfo->mime_type); @@ -344,5 +345,6 @@ void mate_wp_item_update_description (MateWPItem * item) { g_free (size); g_free (dirname); g_free (artist); + g_free (description); } } -- cgit v1.2.1