summaryrefslogtreecommitdiff
path: root/mate-dictionary
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-09-24 20:51:01 +0200
committerPablo Barciela <[email protected]>2018-09-24 20:51:01 +0200
commit2f8d89d7f455c6e229ebb12ed290335bdb535fe5 (patch)
tree63ebfb6bc5591bfa439a57f0741ec3a1b26001f8 /mate-dictionary
parentd541d6ec2639a9b4431d54713f8afb6da1718d03 (diff)
downloadmate-utils-2f8d89d7f455c6e229ebb12ed290335bdb535fe5.tar.bz2
mate-utils-2f8d89d7f455c6e229ebb12ed290335bdb535fe5.tar.xz
mate-dictionary: Fix memory leak
Diffstat (limited to 'mate-dictionary')
-rw-r--r--mate-dictionary/src/gdict-pref-dialog.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mate-dictionary/src/gdict-pref-dialog.c b/mate-dictionary/src/gdict-pref-dialog.c
index 5b8a6de7..5975c686 100644
--- a/mate-dictionary/src/gdict-pref-dialog.c
+++ b/mate-dictionary/src/gdict-pref-dialog.c
@@ -459,19 +459,22 @@ static void
font_button_font_set_cb (GtkWidget *font_button,
GdictPrefDialog *dialog)
{
- const char *font;
+ gchar *font;
font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (font_button));
- if (!font || font[0] == '\0')
- return;
- if (g_strcmp0 (dialog->print_font, font) == 0)
- return;
-
+ if (!font || font[0] == '\0' || g_strcmp0 (dialog->print_font, font) == 0)
+ {
+ g_free (font);
+ return;
+ }
+
g_free (dialog->print_font);
dialog->print_font = g_strdup (font);
g_settings_set_string (dialog->settings, GDICT_SETTINGS_PRINT_FONT_KEY, dialog->print_font);
+
+ g_free (font);
}
static void