diff options
author | Pavel Shlyak <[email protected]> | 2019-08-29 13:37:30 +0300 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-09-12 15:52:50 +0200 |
commit | ad945b9af41b644dbcc108931bee980d484e9eb7 (patch) | |
tree | 899f35fece5f4831e85c714d081fd2bf39b9550a | |
parent | 045585c722dad76d76a48365ba21c531b419d86a (diff) | |
download | mate-applets-ad945b9af41b644dbcc108931bee980d484e9eb7.tar.bz2 mate-applets-ad945b9af41b644dbcc108931bee980d484e9eb7.tar.xz |
geyes: avoid memory leak
-rw-r--r-- | geyes/themes.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/geyes/themes.c b/geyes/themes.c index aebc8ee1..74878315 100644 --- a/geyes/themes.c +++ b/geyes/themes.c @@ -112,12 +112,11 @@ load_theme (EyesApplet *eyes_applet, const gchar *theme_dir) file_name = g_strdup_printf("%s%s",theme_dir,"/config"); theme_file = fopen (file_name, "r"); + g_free (file_name); if (theme_file == NULL) { g_free (eyes_applet->theme_dir); eyes_applet->theme_dir = g_strdup_printf (GEYES_THEMES_DIR "Default-tiny/"); - g_free (file_name); - file_name = g_strdup (GEYES_THEMES_DIR "Default-tiny/config"); - theme_file = fopen (file_name, "r"); + theme_file = fopen (GEYES_THEMES_DIR "Default-tiny/config", "r"); } /* if it's still NULL we've got a major problem */ @@ -155,8 +154,6 @@ load_theme (EyesApplet *eyes_applet, const gchar *theme_dir) eyes_applet->pupil_height = gdk_pixbuf_get_height (eyes_applet->pupil_image); eyes_applet->pupil_width = gdk_pixbuf_get_width (eyes_applet->pupil_image); - g_free (file_name); - return TRUE; } |