summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-bg.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-10-16 02:02:09 +0200
committerStefano Karapetsas <[email protected]>2012-10-16 02:02:09 +0200
commitc460854d4fe90c8528b6c4d6427ed50fcae3a906 (patch)
treee99c5aa705529b7dc8f7331af4324d3d4ed356a4 /libmate-desktop/mate-bg.c
parent458154dbbfebdc3b7e17c903b63aba792a71a70f (diff)
downloadmate-desktop-c460854d4fe90c8528b6c4d6427ed50fcae3a906.tar.bz2
mate-desktop-c460854d4fe90c8528b6c4d6427ed50fcae3a906.tar.xz
fix g_free call
Diffstat (limited to 'libmate-desktop/mate-bg.c')
-rw-r--r--libmate-desktop/mate-bg.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 0aa62c7..942d54f 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -1689,14 +1689,14 @@ get_as_pixbuf_for_size (MateBG *bg,
else {
GdkPixbufFormat *format;
GdkPixbuf *pixbuf;
- gchar *tmp;
+ gchar *tmp = NULL;
/* If scalable choose maximum size */
format = gdk_pixbuf_get_file_info (filename, NULL, NULL);
if (format != NULL)
tmp = gdk_pixbuf_format_get_name (format);
if (format != NULL &&
- strcmp (tmp, "svg") == 0 &&
+ g_strcmp0 (tmp, "svg") == 0 &&
(best_width > 0 && best_height > 0) &&
(bg->placement == MATE_BG_PLACEMENT_FILL_SCREEN ||
bg->placement == MATE_BG_PLACEMENT_SCALED ||
@@ -1704,7 +1704,8 @@ get_as_pixbuf_for_size (MateBG *bg,
pixbuf = gdk_pixbuf_new_from_file_at_size (filename, best_width, best_height, NULL);
else
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
- g_free (tmp);
+ if (tmp != NULL)
+ g_free (tmp);
if (pixbuf)
file_cache_add_pixbuf (bg, filename, pixbuf);