From c460854d4fe90c8528b6c4d6427ed50fcae3a906 Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Tue, 16 Oct 2012 02:02:09 +0200 Subject: fix g_free call --- libmate-desktop/mate-bg.c | 7 ++++--- 1 file 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); -- cgit v1.2.1