diff options
author | Pablo Barciela <[email protected]> | 2018-09-24 20:51:01 +0200 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2018-09-24 20:51:01 +0200 |
commit | 2f8d89d7f455c6e229ebb12ed290335bdb535fe5 (patch) | |
tree | 63ebfb6bc5591bfa439a57f0741ec3a1b26001f8 | |
parent | d541d6ec2639a9b4431d54713f8afb6da1718d03 (diff) | |
download | mate-utils-2f8d89d7f455c6e229ebb12ed290335bdb535fe5.tar.bz2 mate-utils-2f8d89d7f455c6e229ebb12ed290335bdb535fe5.tar.xz |
mate-dictionary: Fix memory leak
-rw-r--r-- | mate-dictionary/src/gdict-pref-dialog.c | 15 |
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 |