From 3ca6b8a0f122833556e500c0dd0cfb3227180fa1 Mon Sep 17 00:00:00 2001 From: Pavel Vasin Date: Sun, 7 Oct 2012 13:47:08 +0400 Subject: empathy_theme_manager_dup_theme_name_from_path(): fix mem leaks https://bugzilla.gnome.org/show_bug.cgi?id=685652 --- libempathy-gtk/empathy-theme-manager.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libempathy-gtk/empathy-theme-manager.c b/libempathy-gtk/empathy-theme-manager.c index fd58ac49d..6c66c2502 100644 --- a/libempathy-gtk/empathy-theme-manager.c +++ b/libempathy-gtk/empathy-theme-manager.c @@ -440,19 +440,21 @@ empathy_theme_manager_find_theme (const gchar *name) gchar * empathy_theme_manager_dup_theme_name_from_path (const gchar *path) { - gchar *fullname, *result; - gchar **tmp; + gchar *fullname = NULL, *result = NULL; + gchar **tmp = NULL; if (path == NULL) return NULL; fullname = g_path_get_basename (path); if (!g_str_has_suffix (fullname, ".AdiumMessageStyle")) - return NULL; + goto out; tmp = g_strsplit (fullname, ".AdiumMessageStyle", 0); result = g_strdup (tmp[0]); +out: g_strfreev (tmp); + g_free (fullname); return result; } -- cgit v1.2.3