[Xfce4-commits] [apps/xfdashboard] 01/01: Fix use-after-free and use more descriptive messages
noreply at xfce.org
noreply at xfce.org
Wed Sep 2 21:53:11 CEST 2015
This is an automated email from the git hooks/post-receive script.
nomad pushed a commit to branch master
in repository apps/xfdashboard.
commit e4d4c36f268f038e8afc24a4e35bd4b1ef59ef4b
Author: Stephan Haller <nomad at froevel.de>
Date: Wed Sep 2 21:52:38 2015 +0200
Fix use-after-free and use more descriptive messages
---
xfdashboard/image-content.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/xfdashboard/image-content.c b/xfdashboard/image-content.c
index 8c11582..cb727e7 100644
--- a/xfdashboard/image-content.c
+++ b/xfdashboard/image-content.c
@@ -333,7 +333,7 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
{
XfdashboardImageContentPrivate *priv;
gchar *lookupFilename;
- const gchar *filename;
+ gchar *filename;
g_return_if_fail(XFDASHBOARD_IS_IMAGE_CONTENT(self));
@@ -371,7 +371,9 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
{
GtkIconInfo *iconInfo;
- g_warning(_("Icon file '%s' does not exist - trying fallback icon"), priv->iconName);
+ g_warning(_("Icon file '%s' does not exist - trying fallback icon '%s'"),
+ priv->iconName,
+ priv->missingIconName);
iconInfo=gtk_icon_theme_lookup_icon(priv->iconTheme,
priv->missingIconName,
@@ -391,7 +393,7 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
}
/* Check if have to use built-in GdkPixbuf for icon ... */
- filename=gtk_icon_info_get_filename(iconInfo);
+ filename=g_strdup(gtk_icon_info_get_filename(iconInfo));
#ifdef USE_GTK_BUILTIN_ICONS
if(!filename)
{
@@ -426,7 +428,7 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
g_object_unref(iconInfo);
}
/* ... otherwise set up to load icon async */
- else filename=lookupFilename;
+ else filename=g_strdup(lookupFilename);
/* Load image asynchronously if filename is given */
if(filename)
@@ -454,6 +456,7 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
/* Release allocated resources */
g_object_unref(file);
g_free(lookupFilename);
+ g_free(filename);
return;
}
@@ -474,6 +477,7 @@ static void _xfdashboard_image_content_load_from_file(XfdashboardImageContent *s
/* Release allocated resources */
g_object_unref(stream);
g_object_unref(file);
+ g_free(filename);
g_debug("Loading icon '%s' from file %s", priv->iconName, filename);
}
@@ -613,7 +617,9 @@ static void _xfdashboard_image_content_load_from_icon_name(XfdashboardImageConte
/* If we got no icon info we try to fallback icon next */
if(!iconInfo)
{
- g_warning(_("Could not lookup themed icon '%s'"), priv->iconName);
+ g_warning(_("Could not lookup themed icon '%s' - trying fallback icon '%s'"),
+ priv->iconName,
+ priv->missingIconName);
iconInfo=gtk_icon_theme_lookup_icon(priv->iconTheme,
priv->missingIconName,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list