summaryrefslogtreecommitdiff
path: root/geyes
diff options
context:
space:
mode:
authorPavel Shlyak <[email protected]>2019-08-29 13:37:30 +0300
committerraveit65 <[email protected]>2019-08-29 13:14:07 +0200
commitf11f56cc8521d7b680adf9da6dc7b6a00634209c (patch)
treef612e62670bc55fcac125047afb065f11aa63a8c /geyes
parentac49426ee506384ee66b3ba1ef4349216aad82ea (diff)
downloadmate-applets-f11f56cc8521d7b680adf9da6dc7b6a00634209c.tar.bz2
mate-applets-f11f56cc8521d7b680adf9da6dc7b6a00634209c.tar.xz
geyes: avoid memory leak
Diffstat (limited to 'geyes')
-rw-r--r--geyes/themes.c7
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;
}